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 Join to answer
Community showcase
Sarah Schuster
Posted Jan 29, 2018 in Jira

What are common themes you've seen across successful & failed Jira Software implementations?

Hey everyone! My name is Sarah Schuster, and I'm a Customer Success Manager in Atlassian specializing in Jira Software Cloud. Over the next few weeks I will be posting discussion topics (8 total) to ...

3,319 views 14 20
Join discussion

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
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot