Modify

Opened 7 years ago

Closed 7 years ago

Last modified 3 years ago

#9463 closed defect (fixed)

Changing the conloglevel value makes no difference in log output

Reported by: ferob Owned by: developers
Priority: normal Milestone: Barrier Breaker 14.07
Component: base system Version: Trunk
Keywords: conloglevel log level output Cc:

Description

Changing the conloglevel value in /etc/config/system to anything between 0-7 makes no difference from the debug value 7 in log output.

Attachments (0)

Change History (9)

comment:1 Changed 7 years ago by jow

  • Resolution set to wontfix
  • Status changed from new to closed

Yes, it also clearly documented in the source. Actually, only 5, 8 and 9 are used.
If you feel this indeed a bug then please report it upstream at busybox.net

comment:2 Changed 7 years ago by ferob

  • Resolution wontfix deleted
  • Status changed from closed to reopened

Okay, but I said conloglevel not cronloglevel.
The conloglevel should be between 0 and 7 or am I missing something?
The cronloglevel values are working fine.
The problem is with conloglevel.

comment:3 Changed 7 years ago by jow

  • Resolution set to wontfix
  • Status changed from reopened to closed

Yes according to the documentation it should be between 0 .. 7. We use BusyBox sysklogd unmodified, programs logging there use either the "logger" utility or the "openlog()" and "syslog()" api calls, nothing OpenWrt specific here. Please report it upstream.

comment:4 Changed 7 years ago by anonymous

This small change in /etc/init.d/boot lets busybox syslogd recognize the conloglevel setting:

line 32 from:
syslogd -C${log_size} ${log_ip:+-L -R ${log_ip}:${log_port}}

to:
syslogd -C${log_size} ${log_ip:+-L -R ${log_ip}:${log_port}} ${conloglevel:+-l $conloglevel}

comment:5 follow-up: Changed 7 years ago by anonymous

  • Resolution wontfix deleted
  • Status changed from closed to reopened

btw. it seems syslogd needs the loglevel to be +1 than selected to work correctly. So the line needs to be:

syslogd -C${log_size} ${log_ip:+-L -R ${log_ip}:${log_port}} ${conloglevel:+-l $(( $conloglevel + 1 )) }

comment:6 in reply to: ↑ 5 Changed 7 years ago by anonymous

Replying to anonymous:

btw. it seems syslogd needs the loglevel to be +1 than selected to work correctly. So the line needs to be:

syslogd -C${log_size} ${log_ip:+-L -R ${log_ip}:${log_port}} ${conloglevel:+-l $(( $conloglevel + 1 )) }


The /etc/init.d/boot fix should only apply conloglevel option to syslogd without any alterations/increment.

In addition LuCI WebIF dropdown list should be modified to increment the values associated to the listed log message levels to fix the additional loglevel +1 issue:

syslogd and klogd require a range of 1-8 (ref syslogd.c and klogd.c usage: comments) whereas LuCI incorrectly assumes that such range is 0-7 (loglevel constants defined in linux/kernel.h )

       #define KERN_EMERG    "<0>"  /* system is unusable               */
       #define KERN_ALERT    "<1>"  /* action must be taken immediately */
       #define KERN_CRIT     "<2>"  /* critical conditions              */
       #define KERN_ERR      "<3>"  /* error conditions                 */
       #define KERN_WARNING  "<4>"  /* warning conditions               */
       #define KERN_NOTICE   "<5>"  /* normal but significant condition */
       #define KERN_INFO     "<6>"  /* informational                    */
       #define KERN_DEBUG    "<7>"  /* debug-level messages             */

Thus:

In order to get only KERN_EMERG level messages syslogd -l1 should be invoked (option 'conloglevel' '1')

In order to get only KERN_EMERG, KERN_ALERT and KERN_CRIT level messages syslogd -l3 should be invoked (option 'conloglevel' '3')

comment:7 Changed 7 years ago by jow

  • Resolution set to fixed
  • Status changed from reopened to closed

Added in r27400

comment:8 Changed 4 years ago by jow

  • Milestone changed from Attitude Adjustment 12.09 to Barrier Breaker 14.07

Milestone Attitude Adjustment 12.09 deleted

comment:9 Changed 3 years ago by anonymous

This bug has bitten me hard, because I use bluetooth hc05 module connected to atheros based device running OpenWrt, and reading "official" documentation [1]

When conloglevel is set to 0 there are LOTS of messages being shown in console, and that messed with out bluetooth modules that communicate over uart. Once we put conloglevel to "1" log messages stopped.

So be warned! Should the wiki documentation be fixed to reflect this? Should wiki documentation say that that conloglevel should be 1-8 instead as it says now 0-8?

[1] http://wiki.openwrt.nanl.de/doc/uci/system

Add Comment

Modify Ticket

Action
as closed .
The resolution will be deleted. Next status will be 'reopened'.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.