how to configure per-host logging with rsyslogd

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

how to configure per-host logging with rsyslogd

Jerry Lin
Hello,

I'm running tomcat9 on Debian 10 (systemd). The logging appears to go
through rsyslog.d and there is a /etc/rsyslog.d/tomcat9.conf that
seems to govern the location of the logs:

:programname, startswith, "tomcat9" {
  /var/log/tomcat9/catalina.out;TomcatFormat
  stop
}

My setup is that I have multiple virtual hosts running (i.e. different
sites), and I would like the messages for the different WAR
files/hosts to end up in different log files (e.g. example.com.out ,
site.com.out). How do I do this?


Things that I've tried:
1. Modifying /etc/rsyslog.d/tomcat9.conf and introducing templates
with %HOSTNAME% template, which just ends up with the name of the
machine, rather than the website.
2. Modifying /etc/tomcat9/logging.properties; this seems to be
overridden by /etc/rsyslog.d/tomcat9.conf.

Thanks for your help,
Jerry

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]