dimanche 27 avril 2014

Log4j socketappender configuration for grails app?


Vote count:

0




I have a Grails 2.3.7 app.


In Config.groovy I have added -



log4j = {
appenders {
rollingFile name:'stdout', file:"${logDirectory}/myapp.log".toString()
rollingFile name:'stacktrace', file:"${logDirectory}/stacktrace_myapp.log".toString()
appender new org.apache.log4j.net.SocketAppender(name:'central',
layout:pattern(conversionPattern:'%d{ISO8601} %-5p %c{2} %x - %m%n'),
remoteHost: 'localhost', port: 4560, reconnectionDelay: 10000,locationInfo:true)
}
info 'grails.app'
error 'org.codehaus.groovy.grails.web.servlet', // controllers
'org.codehaus.groovy.grails.web.pages', // GSP
'org.codehaus.groovy.grails.web.sitemesh', // layouts
'org.codehaus.groovy.grails.web.mapping.filter', // URL mapping
'org.codehaus.groovy.grails.web.mapping', // URL mapping
'org.codehaus.groovy.grails.commons', // core / classloading
'org.codehaus.groovy.grails.plugins', // plugins
'org.codehaus.groovy.grails.orm.hibernate', // hibernate integration
'org.springframework',
'org.hibernate',
'net.sf.ehcache.hibernate'
//debug 'org.apache.http.wire'
}


I have also installed Logstash to listen to the log messages. logstash conf. file -



input {
log4j {
mode => "server"
host => "localhost"
port => 4560
type => log4j
}
}

output {
elasticsearch { host => localhost }
stdout { codec => rubydebug }
}


But I do not see any logs being parsed by logstash. That is, there is no output on either stdout or the elasticsearch interface. Though I am able to see logs being generated in myapp.log file



localhost:9200/_search?pretty




asked 37 secs ago






Aucun commentaire:

Enregistrer un commentaire