Search code examples
linuxtomcatsyslog-ng

Tomcat syslog add custom tag in log file


We are running multiple tomcats instances in single box for different different applications, and we are sending logs to syslog using following lines in tomcat config.

JAVA_OPTS="$JAVA_OPTS -Dserver.syslog.host=logserver1.example.com"
JAVA_OPTS="$JAVA_OPTS -Dserver.syslog.level=WARN"

Is there anyway i can add custom tag in log file so i can log them base on per instances?


Solution

  • Why not to use log4j ?

    You can configure log4j.properties for each instance and then choose different PatternLayout/ConversionPatterns for every instance.

    You should be able to add custom tags while mentioning patterns.