Push JIRA logs to syslog server

I need to push JIRA logs (tomcat logs) to remote syslog server.

2 answers

1 accepted

Hi Heshan,

Try to use syslog appender. In log4j properties you add it and then you have to insert DNS SERVER NAME.... :)

It would be great if you could provide more information regarding enabling syslog appender.

Do you have a sample code that we can use as a guideline? Thanks

You need to modify log4j.property file.

Add SYSLOG to log4j.rootCategory.

Ex:

# sample properties to initialize

log4j log4j.rootCategory= WARN, console, filelog, SYSLOG, fout


Then add below appender to this file

log4j.appender.SYSLOG.threshold=WARN 
log4j.appender.SYSLOG=org.apache.log4j.net.SyslogAppender 
log4j.appender.SYSLOG.syslogHost=<IP address of local syslog server>
log4j.appender.SYSLOG.layout=org.apache.log4j.EnhancedPatternLayout
log4j.appender.SYSLOG.layout.ConversionPattern=%t %5r %-5p %-21d{yyyyMMdd HH:mm:ss,SSS} %c{2} [%x] %m %throwable{none}
log4j.appender.SYSLOG.Facility=LOCAL0


Then go to /etc/syslog-ng/syslog-ng.conf file

Un-comment below line udp(ip("0.0.0.0") port(514));


and add below lines

destination df_remote_log { udp("<IP address of remote syslog server>" port(514)); };
filter f_mit { facility(LOCAL0); };
log {
source(src);
filter(f_mit); destination(df_remote_log);
};

Finally restart tomcat and syslog services

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Published Monday in Jira Software

How large do you think Jira Software can grow?

Hi Atlassian Community! My name is Shana, and I’m on the Jira Software team. One of the many reasons this Community exists is to connect you to others on similar product journeys or with comparabl...

607 views 6 12
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you