On Fri, 11 Jul 2008, Fabio M. Di Nitto wrote:


Hi Steven,

syslog should generally get only relevant messages for sysadmin tasks. All debugging output should go only to_file/logfile.

the patch filters LOG_LEVEL_DEBUG messages from being sent to syslog.

Please apply.

Fabio


New patch based on IRC discussion.

Please apply

Fabio

--
I'm going to make him an offer he can't refuse.
Index: exec/logsys.c
===================================================================
--- exec/logsys.c       (revision 1575)
+++ exec/logsys.c       (working copy)
@@ -277,7 +277,9 @@
                fflush (stdout);
        }
 
-       if (logsys_mode & LOG_MODE_OUTPUT_SYSLOG_THREADED) {
+       if ((logsys_mode & LOG_MODE_OUTPUT_SYSLOG_THREADED) &&
+               (!((logsys_mode & LOG_MODE_FILTER_DEBUG_FROM_SYSLOG) &&
+                  (log_data->priority == LOG_LEVEL_DEBUG)))) {
                syslog (log_data->priority,
                        &log_data->log_string[log_data->syslog_pos]);
        }
Index: exec/logsys.h
===================================================================
--- exec/logsys.h       (revision 1575)
+++ exec/logsys.h       (working copy)
@@ -55,6 +55,7 @@
 #define LOG_MODE_FLUSH_AFTER_CONFIG    (1<<9)
 #define LOG_MODE_SHORT_FILELINE                (1<<10)
 #define LOG_MODE_NOSUBSYS              (1<<11)
+#define LOG_MODE_FILTER_DEBUG_FROM_SYSLOG      (1<<12)
 
 /*
  * Log priorities, compliant with syslog and SA Forum Log spec.
Index: man/logsys_overview.8
===================================================================
--- man/logsys_overview.8       (revision 1575)
+++ man/logsys_overview.8       (working copy)
@@ -77,8 +77,8 @@
 The facility parameter is the syslog facility that should be used when logging
 messages.
 LOG_MODE_NOSUBSYS: Enabling this mode removes the subsystem tag from the 
beginning of the log lines.  This is not recommended for programs which have 
multiple subsystems.
+LOG_MODE_FILTER_DEBUG_FROM_SYSLOG: Enabling this mode will stop debug messages 
from being sent to syslog.
 
-
 An example declaration would be:
 
 #include <openais/logsys.h>
_______________________________________________
Openais mailing list
[email protected]
https://lists.linux-foundation.org/mailman/listinfo/openais

Reply via email to