1)建立文件/var/log/pureftpd.log
2)修改/etc/rsyslog.conf 1>在这行的cron.none后面添加 ;ftp.none 使ftp的日志信息成私有
*.info;mail.none;authpriv.none;cron.none /var/log/messages
为
*.info;mail.none;authpriv.none;cron.none;ftp.none /var/log/messages 2>在/etc/rsyslog.conf文件最后加上
#pureftp日志
ftp.* -/var/log/pureftpd.log
注意: 不要去掉/var前面的-号,否则日志会在/var/log/messages与/var/log/purefpd.log里各记录一份. 添加了-号,就只会记录在/var/log/purefptd.log内
3)使/etc/rsyslog.conf生效
[test@www.cnscn.org ]# killall -HUP syslogd
到现在设置完毕,重启下pure-ftpd,现在在客户端登陆ftp试下
=============[附我的rsyslog.conf]==========================
#*.=info;*.=notice;*.=warn;\
auth,authpriv.none;\
cron,daemon.none;\
mail,news.none;ftp.none -/var/log/messages
#
# Emergencies are sent to everybody logged in.
#
*.emerg *
#
# I like to have messages displayed on the console, but only on a virtual
# console I usually leave idle.
#
#daemon,mail.*;\
# news.=crit;news.=err;news.=notice;\
# *.=debug;*.=info;\
# *.=notice;*.=warn /dev/tty8
# The named pipe /dev/xconsole is for the `xconsole' utility. To use it,
# you must invoke `xconsole' with the `-file' option:
#
# $ xconsole -file /dev/xconsole [...]
#
# NOTE: adjust the list below, or you'll go crazy if you have a reasonably
# busy site..
#
daemon.*;mail.*;\
news.err;\
*.=debug;*.=info;\
*.=notice;*.=warn |/dev/xconsole
#pure-ftpd log
ftp.* -/var/log/pureftpd.log