diff -pru busybox-1.2.2.1/include/usage.h busybox-1.2.2.1.raf/include/usage.h --- busybox-1.2.2.1/include/usage.h 2006-07-01 00:42:10.000000000 +0200 +++ busybox-1.2.2.1.raf/include/usage.h 2008-09-05 11:31:13.228428522 +0200 @@ -2866,6 +2866,7 @@ USE_FEATURE_START_STOP_DAEMON_FANCY( \ "Linux system and kernel logging utility.\n" \ "Note that this version of syslogd ignores /etc/syslog.conf.\n\n" \ "Options:\n" \ + "\t-l NUM\tSets the local log level of messages to n (default=8, range=1-8).\n"\ "\t-m MIN\t\tMinutes between MARK lines (default=20, 0=off)\n" \ "\t-n\t\tRun as a foreground process\n" \ "\t-O FILE\t\tUse an alternate log file (default=/var/log/messages)\n" \ diff -pru busybox-1.2.2.1/sysklogd/syslogd.c busybox-1.2.2.1.raf/sysklogd/syslogd.c --- busybox-1.2.2.1/sysklogd/syslogd.c 2008-09-05 11:36:16.675308107 +0200 +++ busybox-1.2.2.1.raf/sysklogd/syslogd.c 2008-09-05 11:31:18.516624777 +0200 @@ -41,6 +41,9 @@ /* Path for the file where all log messages are written */ #define __LOG_FILE "/var/log/messages" +/* level of messages to be locally logged */ +static int logLevel = 8; + /* Path to the unix socket */ static char lfile[MAXPATHLEN]; @@ -437,6 +440,7 @@ static void logMessage(int pri, char *ms if (local_logging == TRUE) #endif + if (pri == 0 || LOG_PRI(pri) < logLevel) { /* now spew out the message to wherever it is supposed to go */ if (small) @@ -627,7 +631,7 @@ int syslogd_main(int argc, char **argv) char *p; /* do normal option parsing */ - while ((opt = getopt(argc, argv, "m:nO:s:Sb:R:LC::")) > 0) { + while ((opt = getopt(argc, argv, "m:l:nO:s:Sb:R:LC::")) > 0) { switch (opt) { case 'm': MarkInterval = atoi(optarg) * 60; @@ -638,6 +642,14 @@ int syslogd_main(int argc, char **argv) case 'O': logFilePath = optarg; break; + case 'l': + logLevel = atoi(optarg); + /* Valid levels are between 1 and 8 */ + if (logLevel < 1 || logLevel > 8) { + bb_show_usage(); + } + break; + #ifdef CONFIG_FEATURE_ROTATE_LOGFILE case 's': logFileSize = atoi(optarg) * 1024;