syslogd with process name/id

Giovanni Vallesi - TeeBX giovanni.v at teebx.com
Mon Jul 8 11:35:56 UTC 2013


Il 07/07/2013 15.32, Woody Wu ha scritto:
> How to make each log message saved by syslogd has a process id/name
> --just like what log messages appear in desktop linux?

Harald already explained, here you can see a simple demonstration:
- syalog start by init, but no pid
- some well known apps with pid
- shell calls from scripts without a pid
- call to logger in the shell, default to username but no pid
- call to logger function with tag/pid

Jan 1 01:25:25 syslogd started: BusyBox v1.21.0
Jan 1 01:25:25 init: starting pid 82, tty '': '/etc/rc.bootup'
Jan 1 02:25:28 udhcpc[138]: udhcpc (v1.21.0) started
Jan 1 02:25:28 udhcpc[138]: Sending discover...
Jan 1 02:25:29 udhcpc[138]: Sending select for 172.31.255.119...
Jan 1 02:25:29 udhcpc[138]: Lease of 172.31.255.119 obtained, lease time 
7200
Jan 1 02:25:30 ntpclient[146]: Using server: pool.ntp.org
Jul 8 13:07:51 ntpclient[146]: Time set from remote server via 
settimeofday()
Jul 8 13:07:51 ntpclient[146]: Skew 110972541082.5mS, freq adjust 0
Jul 8 13:07:51 chpasswd: Password for 'root' changed
Jul 8 13:07:51 dropbear[170]: Running in background
Jul 8 13:07:51 crond[181]: crond: crond (busybox 1.21.0) started, log 
level 0
Jul 8 11:07:51 init: starting pid 183, tty '/dev/ttyS0': '/etc/rc.initial'
Jul 8 13:08:00 dropbear[229]: Child connection from 172.31.255.40:1679
Jul 8 13:08:06 dropbear[229]: password auth succeeded for 'root' from 
172.31.255.40:1679
Jul 8 13:14:31 root: hello from shell to syslog
Jul 8 13:15:21 myTag: logger test using tag but no pid
Jul 8 13:14:54 myAppTag[584]: logger test using tag an pid


-- 
TeeBX VoIP communication platform (coming soon)
http://code.google.com/p/teebx/
-----------------------------------------------
Lightweight++ Business Friendly++ Open++


More information about the busybox mailing list