Alexander Farber
2011-Mar-20 13:55 UTC
[CentOS] syslog.conf - how to redirect messages by a program name?
Hello, the "man syslog.conf" explains how to filter syslog messages by facility (auth, authpriv, cron, daemon, kern, ... ) or by priority (debug, info, notice, warning, ...). But how could I redirect messages by a program name, like "drupal" or "php"? For example I have in /var/log/messages: Mar 20 04:20:44 mysite drupal: http://mysite|1300594844|page not found|66.249.66.193|http://mysite/sites/default/files/pictures/picture-7133-1300462418.png||0||sites/default/files/pictures/picture-71333-1300462418.png Mar 20 04:20:50 mysite drupal: http://www.mysite|1300594850|page not found|93.158.148.31|http://www.mysite/viewtopic.php?f=5&t=42639&p=165661&sid=73944439da6ca3054a40f464ce97a628||0||viewtopic.php but I would like them to go under /var/log/drupal (and I'll rotate them later by adding a file to /etc/logrotate.d ....) Regards Alex _______________________________________________ CentOS mailing list CentOS at centos.org http://lists.centos.org/mailman/listinfo/centos _______________________________________________ CentOS mailing list CentOS at centos.org http://lists.centos.org/mailman/listinfo/centos
Markus Falb
2011-Mar-20 14:00 UTC
[CentOS] syslog.conf - how to redirect messages by a program name?
On 20.3.2011 14:55, Alexander Farber wrote:> the "man syslog.conf" explains how to filter syslog messages > by facility (auth, authpriv, cron, daemon, kern, ... ) or > by priority (debug, info, notice, warning, ...). > > But how could I redirect messages by a program name, like > "drupal" or "php"? For example I have in /var/log/messages:Classic syslog can not do this. But there are alternative syslogs available. syslog-ng can filter by program name. I am not sure about rsyslog. -- Best Regards, Markus Falb -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 267 bytes Desc: OpenPGP digital signature URL: <http://lists.centos.org/pipermail/centos/attachments/20110320/944fd04f/attachment-0005.sig> -------------- next part -------------- _______________________________________________ CentOS mailing list CentOS at centos.org http://lists.centos.org/mailman/listinfo/centos -------------- next part -------------- _______________________________________________ CentOS mailing list CentOS at centos.org http://lists.centos.org/mailman/listinfo/centos
Brunner, Brian T.
2011-Mar-21 14:41 UTC
[CentOS] syslog.conf - how to redirect messages by a program name?
centos-bounces at centos.org wrote:> Hello, > > the "man syslog.conf" explains how to filter syslog messages > > But how could I redirect messages by a program name, like > "drupal" or "php"? I would like them to go under /var/log/drupalThis 1-liner script needs fired off at system boot. tail --follow=name --retry /var/log/messages | grep drupal: > /var/log/drupal The grep patters might be expanded -E "(drupal|php)" Insert spiffy .sig here: Life is complex: it has both real and imaginary parts. //me ******************************************************************* This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This footnote also confirms that this email message has been swept for the presence of computer viruses. www.Hubbell.com - Hubbell Incorporated** _______________________________________________ CentOS mailing list CentOS at centos.org http://lists.centos.org/mailman/listinfo/centos