On Thu, 27 Nov 2014, Ravichandra Minnikanti wrote:

Hi,

I am using rsyslogd 8.4.4 in Ubuntu 14.04. I want my applications logs to
be in a separate log file(ex : /var/log/mylog.log).Before I used rsyslog 5v
on ubuntu 12.04 for the same purpose and it worked. I used the following
snippet with rsyslog 5v serve my purpose.Following are the lines in my
application that writes logs to syslog.

setlogmask (LOG_UPTO (LOG_NOTICE));
openlog ("thelog", LOG_CONS | LOG_PID | LOG_NDELAY, LOG_LOCAL1);
syslog (LOG_NOTICE, "thelog : started by User %d", getuid ()); closelog();

And the following lines in /etc/rsyslog.d/50-default.conf configuration file

local1.*                -/var/log/thelog.log

Now the above method no longer works with new rsyslog 8.4v. I even
tried the following line

This should still work (although the - doesn't do anything). There must be something else in your config that is causing the problem, or your messages aren't being logged the way you think they are.


try writing a log with the format RSYSLOG_DebugFormat

/var/log/testlog;RSYSLOG_DebugFormat

and look for the logs from your app and see if they are being logged as local1 the way you think they are.

If the testlog doesn't show up, send us the rest of your config file, you may be doing something like changing what user rsyslog runs as and that user doesn't have permission to create files there.

David Lang

if $syslogfacility-text == 'local1' then /var/log/mylog.log

Even this is not working. Can someone suggest me, how to do it.


Thanks in advance.

Regards,

Ravi
_______________________________________________
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.

_______________________________________________
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