取消
顯示結果 
搜尋替代 
您的意思是: 

關於syslog.conf的寫法

關於syslog.conf的寫法

我看到default syslog.conf寫法如下

kern.debug /var/adm/syslog.dated/kern.log user.debug /var/adm/syslog.dated/user.log

但是用ls 去看該路徑卻是找不到的

實際路徑應該是/var/adm/syslog.dated/current

這是怎樣做到的,ls找不到,syslog 卻自己會去current 路徑底下寫資料

# ls /var/adm/syslog.dated/kern.log ls: /var/adm/syslog.dated/kern.log not found

1 回覆

關於syslog.conf的寫法

Hi Joey,



> 這是怎樣做到的,ls找不到,syslog 卻自己會去current 路徑底下寫資料

This is handled by the process "syslogd". See "man"



# man syslogd

.

Destinations for logged messages can be specified with full pathnames that

begin with a leading / (slash). The syslogd daemon then opens the speci-

fied file(s) in append mode. If the pathname to a syslogd daemon log file

that is specified in the syslog.conf file as a /var/adm/syslog.dated/file,

the syslogd daemon inserts a date directory, and thus produces a day-by-day

account of the messages received, directly above file in the directory

structure. Typically, you will want to divert messages separately, accord-

ing to facility, into files such as kern.log, mail.log, lpr.log, and

debug.log. The file /var/adm/syslog.dated/current is a link to the most

recent log file directory.



If some pathname other than /var/adm/syslog.dated/file is specified as the

pathname to the logfile, the syslogd daemon does not create the daily date

directory. For example, if you specify /var/adm/syslog/mail.log (without

the .dated suffix after syslog), the syslogd daemon simply logs messages to

the mail.log file and allows this file to grow indefinitely.



PS: The keyword ".dated" in syslog.conf is passed this function by syslogd.



Best regards,

Richard.