Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to configure Tomcat to log everything via syslog?

Tags:

People also ask

Does Tomcat use log4j by default?

Apache Tomcat. Log4j may be used as the logging framework for Apache Tomcat. This support is implemented automatically by including the log4j-api, log4j-core, and log4j-appserver jars in the boot classpath.

Do Apache Tomcat generate log files?

Once Apache Tomcat starts, it will create several log files in the /opt/bitnami/tomcat/logs directory. The main log file is the catalina. out file where you can find error messages. On some platforms, you may need root account privileges to view these files.


I'm trying to configure Tomcat and a webapp (Atlassian JIRA) to log everything over syslog.

Here is what I added to the webapp log4j.properties (atlassian-jira/WEB-INF/classes/log4j.properties) :

log4j.rootLogger=WARN, syslog
log4j.appender.syslog=org.apache.log4j.net.SyslogAppender
log4j.appender.syslog.facility=LOCAL0
log4j.appender.syslog.layout.ConversionPattern=%-5p [%t] [%c]: %m%n
log4j.appender.syslog.layout=org.apache.log4j.PatternLayout
log4j.appender.syslog.SyslogHost=my.syslog.server.fqdn

However, nothing is sent over syslog. I sniffed outgoing packets on the port 514 and nothing appears.

Thanks for your help!