Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Next revisionBoth sides next revision
docs:guide-user:base-system:log.essentials [2023/10/27 14:53] – [Alternative implementations] elux011docs:guide-user:base-system:log.essentials [2024/06/02 06:30] – [logread] stokito
Line 55: Line 55:
  
 ===== logd ===== ===== logd =====
-''logd'' is configured in ''/etc/config/system''. After changing the file, run +''logd'' is a default OpenWrt logging daemon provided by [[https://github.com/openwrt/ubox|ubox]] package. 
 +It also listens for ''/dev/log'' and records syslog messages. 
 +It'configured in ''/etc/config/system''. After changing the file, run 
  
 <code bash> <code bash>
Line 70: Line 72:
  
 ==== logread ==== ==== logread ====
-This is the default interface and the simplest+This is the default interface to read log messages. It's provided by the [[https://github.com/openwrt/ubox|ubox]] package. 
-It is a local executable that will read the ring buffer records and display them chronologically.+ 
 +It is a local executable in ''/sbin/logread'' that will read the ring buffer records and display them chronologically. 
 + 
 +To show all log messages that contains a specific text (like a daemon name) and follow (like in ''tail -f'') use: 
 +<code bash> 
 +logread -fe firewall 
 +</code> 
 + 
 +Options: 
 +<code> 
 +-s <path> Path to ubus socket 
 +-l <count> Got only the last 'count' messages 
 +-e <pattern> Filter messages with a regexp 
 +-r <server> <port> Stream message to a server 
 +-F <file> Log file 
 +-S <bytes> Log size 
 +-p <file> PID file 
 +-h <hostname> Add hostname to the message 
 +-P <prefix> Prefix custom text to streamed messages 
 +-z <facility> handle only messages with given facility (0-23), repeatable 
 +-Z <facility> ignore messages with given facility (0-23), repeatable 
 +-f Follow log messages 
 +-u Use UDP as the protocol 
 +-t Add an extra timestamp 
 +-0 Use \0 instead of \n as trailer when using TCP 
 +</code> 
 + 
 +Please note that if you install the [[:docs:guide-user:perf_and_log:log.syslog-ng3|syslog-ng]] then the logread command will be overridden with it's own ''/usr/sbin/logread'' that has less options. 
 + 
  
 ==== Local file logging ==== ==== Local file logging ====
  • Last modified: 2024/07/27 17:26
  • by stokito