Friday 22 August 2008

uShare syslog priority

A standard uShare installation logs its 'business as usual' type messages to syslog with a facility of 'daemon' and a priority of 'notice'. My preference is for these type of messages to be logged with a priority of 'info', reserving priorities of 'notice' and above for logging out of the ordinary events.

Here's a simple patch for uShare 1.1a to fix this behaviour:


--- ushare-1.1a.orig/src/trace.c 2007-12-09 13:03:36.000000000 +0000
+++ ushare-1.1a/src/trace.c 2008-08-22 20:52:04.000000000 +0100
@@ -46,7 +46,7 @@
if (is_daemon)
{
int flags = LOG_DAEMON;
- flags |= level == ULOG_ERROR ? LOG_ERR : LOG_NOTICE;
+ flags |= level == ULOG_ERROR ? LOG_ERR : LOG_INFO;
vsyslog (flags, format, va);
}
else

No comments: