internetitem/logback-elasticsearch-appender

Hi- thanks for your appender

Closed this issue · 5 comments

hi
Can you please add an example of your appender for logbzck.groovy ?

i tried to translate it from logback.xml but it doesn't work for me.

I'll be honest - I've never actually use a groovy configuration. But if you find one that works, I'd be happy to add it to the documentation. Maybe post what you have here (and what problems you are having) and someone may come along and offer assistance.

appender("ELASTIC", ElasticsearchAppender){
	url = 'http://elastic:changeme@localhost:9200/_bulk'
	index = 'logs-%date{yyyy-MM-dd}'
	type = 'log'
	rawJsonMessage = true
	errorsToStderr = true
	authentication = new BasicAuthentication()
	def configHeaders = new HttpRequestHeaders()
	configHeaders.addHeader(new HttpRequestHeader(name: 'Content-Type', value: 'text/plain'))
	headers = configHeaders
}

@marksmithson Mind if I add this to the README.md? Or if you would like the credit, feel free to submit a PR.

Done - apologies for the delay - work got in the way!

#33