Try adding
if $msg contains "testtest" then ?CATALINAOUTFILE;RSYSLOG_DebugFormat

then do

logger -p local2.info -t ondemand[test] testtest

and look at what shows up in the file.

If nothing shows up, then we want to look at the debug logs to see if there was an error recorded when it tried to open the file (there could be problems with permissions, including SELinux or AppArmor permissions)

If something does show up in the file, then you can see what all the variables are parsed out to and then look at the logic involved.

David Lang


On Tue, 13 Jan 2015, jawed abbasi wrote:

Thanks DavidI have trying hard to figure out how to debug logger not getting 
kicked by tomcat using log4j properties file without any luck.
I kicked of logger manually as below; but i still don't see much happening.
logger -p local2.info -t ondemand[test]
Any hints or pointers that can help in troubleshooting this issue?
Thanks

     From: David Lang <[email protected]>
To: jawed abbasi <[email protected]>; rsyslog-users <[email protected]>
Sent: Saturday, January 10, 2015 3:26 PM
Subject: Re: [rsyslog] rsyslog unble to create tomcat catalina file

On Wed, 7 Jan 2015, jawed abbasi wrote:

Hi
I had perfect working rsyslog before i patched my Ubuntu server; after patch 
rsyslog broke. Since then i have working hard to figure out what caused this.
Os version : Linux hostname  2.6.32-68-server Ubuntu 10.04.4 LTSrsyslog 
version: Version: 4.2.0-2ubuntu8.3

the first thing would be to look at upgrading rsyslog to a currently supported
version, v8.6.0 (with v8.7.0 due to be released in a few days)

When i run rsyslog to test config file it does not complain 
root@hostname:~# rsyslogd  -c4 -f /etc/rsyslog.d/30-tomcat.conf -N3
rsyslogd: version 4.2.0, config validation run (level 3), master config 
/etc/rsyslog.d/30-tomcat.conf
rsyslogd: End of config validation run. Bye.
two obvious issues i see are :
1: logs are not being written to the location per config file 30-tomcat.conf
which has directives as below$template
CATALINAOUTFILE,"/var/log/tomcat/%syslogtag:R,ERE,1,FIELD:\[([^]][^]]*)\]:--end%/catalina.out_%$YEAR%-%$MONTH%-%$DAY%.log"

2: I don't see logger running; which is supposed to be fired up when tomcat is 
started using log4j.properties files.

If logger isn't running to deliver logs to rsyslog, it's not going to have
anything to write. From your description, that sounds like it's probably the
problem.



I have tried to run rsyslog in debug mode; but it does not really complain 
about anything that give me a clue so that I can fix it.I am attaching config 
and log files; if anyone has sympathy to help me to solve this riddle.
Thanks in advance for all the help

grep in the debug output for 'tomcat' and if there are any logs that it's trying
to output, you should see them.

David Lang

_______________________________________________
rsyslog mailing list
http://lists.adiscon.net/mailman/listinfo/rsyslog
http://www.rsyslog.com/professional-services/
What's up with rsyslog? Follow https://twitter.com/rgerhards
NOTE WELL: This is a PUBLIC mailing list, posts are ARCHIVED by a myriad of 
sites beyond our control. PLEASE UNSUBSCRIBE and DO NOT POST if you DON'T LIKE 
THAT.

Reply via email to