Use shellSYslog log file write information
ApplicationProgramUse S The log file (in the/var/log directory) That yslog sends messages to the Linux system ). S Ysklogd provides two System Tools : One is System Log Record , The other is kernel information capture. Most programs usually use the C language or S Yslog application or library to send S Yslog message.
1. the logger command is a shell command (interface ). You can use the syslog System Log Module to directly write a line of information to the system log file.
2. Example
For example, record the system restart information after the hard disk upgrade:
$ Logger system rebooted for hard disk upgrade
Logger-F/var/log/MyApp. Log // record the content in the file to the System Log
Logger-s "Hard Disk Full" // send the message to the screen (standard error)
Logger-I-t my_test.sh-P local3.notice "my_test.sh find some error in... "
-I log the process ID of the logger process with each line
-S log the message to standard error, as well as the system log.
-F File log the specified file.
-T tag mark every line in the log with the specified tag.
Original
[1] http://hi.baidu.com/jackbillow/item/02341e426b6952e3bdf451cf
[2] http://www.chenqing.org/2012/08/use-logger-logrotate-manage-your-logs.html
[3] detailed descriptions of/etc/syslog. conf,/etc/logrotate. conf
Http://www.187299.com/archives/1784