summaryrefslogtreecommitdiffstats
path: root/plugins/imklog/linux.c
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2009-07-03 11:57:21 +0200
committerRainer Gerhards <rgerhards@adiscon.com>2009-07-03 11:57:21 +0200
commitda933a7e105acf814d5e7955d39d29eab3a96613 (patch)
treeef8ee09015316a82e650a6d2805c2787dd36f83f /plugins/imklog/linux.c
parentf03b26b550dc7a08f96753c47e8fb0673f5338ec (diff)
downloadrsyslog-da933a7e105acf814d5e7955d39d29eab3a96613.tar.gz
rsyslog-da933a7e105acf814d5e7955d39d29eab3a96613.tar.xz
rsyslog-da933a7e105acf814d5e7955d39d29eab3a96613.zip
added $klogConsoleLogLevel directive
...which permits to set a new console log level while rsyslog is active
Diffstat (limited to 'plugins/imklog/linux.c')
-rw-r--r--plugins/imklog/linux.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/plugins/imklog/linux.c b/plugins/imklog/linux.c
index 977395ea..727708a5 100644
--- a/plugins/imklog/linux.c
+++ b/plugins/imklog/linux.c
@@ -92,17 +92,14 @@ static uchar *GetPath(void)
static void CloseLogSrc(void)
{
- /* Turn on logging of messages to console, but only if we had the -c
- * option -- rgerhards, 2007-08-01
- */
- if (console_log_level != -1)
+ /* Turn on logging of messages to console, but only if a log level was speficied */
+ if(console_log_level != -1)
ksyslog(7, NULL, 0);
/* Shutdown the log sources. */
- switch ( logsrc )
- {
+ switch(logsrc) {
case kernel:
- ksyslog(0, 0, 0);
+ ksyslog(0, NULL, 0);
imklogLogIntMsg(LOG_INFO, "Kernel logging (ksyslog) stopped.");
break;
case proc:
@@ -153,7 +150,7 @@ static enum LOGSRC GetKernelLogSrc(void)
if ( (kmsg = open((char*)GetPath(), O_RDONLY|O_CLOEXEC)) < 0 )
{
imklogLogIntMsg(LOG_ERR, "imklog: Cannot open proc file system, %d.\n", errno);
- ksyslog(7, NULL, 0); /* TODO: check this, implement more */
+ ksyslog(7, NULL, 0);
return(none);
}