nuttx icon indicating copy to clipboard operation
nuttx copied to clipboard

[HELP] syslog is not printing messages out of console.

Open wangtao13 opened this issue 5 months ago • 4 comments

Description

I am using Nuttx-12.13.0 in my MIPS SOC, and I found the syslog does NOT work as expected. The printf works well to show messages in serial console (/dev/ttyS0). When the system panic occurs, it calls PANIC_WITH_REGS() which uses _alert to output panic info, but I did NOT see the panic info in the serial console.

Here is the configurations about SYSLOG in .config,

# Debug SYSLOG Output Controls
CONFIG_DEBUG_ERROR=y
CONFIG_DEBUG_WARN=y
CONFIG_DEBUG_INFO=y
CONFIG_DEBUG_ASSERTIONS=y
# CONFIG_DEBUG_ASSERTIONS_EXPRESSION is not set
CONFIG_DEBUG_ASSERTIONS_FILENAME=y


CONFIG_SYSLOG=y
# CONFIG_ARCH_SYSLOG is not set
# CONFIG_SYSLOG_NONE is not set
# CONFIG_SYSLOG_CHARDEV is not set
CONFIG_SYSLOG_DEFAULT_MASK=0xff
# SYSLOG options
CONFIG_SYSLOG_CRLF=y
CONFIG_SYSLOG_MAX_CHANNELS=1
# CONFIG_SYSLOG_BUFFER is not set
# CONFIG_SYSLOG_INTBUFFER is not set
# CONFIG_SYSLOG_RFC5424 is not set
# CONFIG_SYSLOG_TIMESTAMP_FORMAT_MICROSECOND is not set
# CONFIG_SYSLOG_PRIORITY is not set
# CONFIG_SYSLOG_PREFIX is not set
# CONFIG_SYSLOG_COLOR_OUTPUT is not set
# CONFIG_SYSLOG_TIMESTAMP is not set
# CONFIG_SYSLOG_PROCESS_NAME is not set
# CONFIG_SYSLOG_PROCESSID is not set
# SYSLOG channels
CONFIG_SYSLOG_DEVPATH="/dev/ttyS0"
# CONFIG_SYSLOG_CHAR is not set
# CONFIG_SYSLOG_STREAM is not set
CONFIG_SYSLOG_CONSOLE=y
CONFIG_SYSLOG_DEFAULT=y
# CONFIG_SYSLOG_RPMSG_SERVER_CHARDEV is not set
# CONFIG_SYSLOG_FILE is not set
# CONFIG_SYSLOG_IOCTL is not set
CONFIG_SYSLOG_REGISTER=y
# CONFIG_SYSLOG_RTT is not set

I am not sure if it is expected in PANIC case or if there is anything wrong in my syslog configuration. Thanks, -Tao

Verification

  • [x] I have verified before submitting the report.

wangtao13 avatar Jun 08 '26 02:06 wangtao13

This may not be anything wrong with your specific setup; I've encountered similar issues where the system panics in a strange way and the syslog dump doesn't make it to the console at all or is cut off in the console. I am not necessarily sure why. Maybe someone like @acassis would know better about this

linguini1 avatar Jul 01 '26 14:07 linguini1

@wangtao13 please verify if CONFIG_DEBUG_ALERT is enabled. Please look at include/nuttx/debug.g to learn more about it.

acassis avatar Jul 01 '26 16:07 acassis

I made it work by enabling CONFIG_SYSLOG_CONSOLE=y, close this issue.

wangtao13 avatar Aug 11 '26 04:08 wangtao13

@wangtao13 this is another good idea to include at NuttX FAQ

acassis avatar Aug 11 '26 12:08 acassis