log on
Array(config)#log http squid novip nohost
Apache Log combined Format
Array(config)#log http combined novip nohost
Array(config)#show log config Logging is on Logging Facility: LOCAL0 Logging source port: 514 Logging level: info Logging option level information is off Logging option logid is off Logging timestamp is on log http squid
show log buff backward show log buff backward
Array(config)#show log buff forward start of buffer INFO Jan 11 22:41:23 CLI: User "array" executed cmd "log on" INFO Jan 11 22:41:30 CLI: User "array" executed cmd "show log config" INFO Jan 11 22:43:00 CLI: User "array" executed cmd "show log buff backward" INFO Jan 11 22:43:15 CLI: User "array" executed cmd "show log buff backward" INFO Jan 11 22:43:27 CLI: User "array" executed cmd "show log buff backward"
Array(config)#log facility LOCAL1 Array(config)#log host 172.16.0.9
linux syslogd
/etc/syslog.conf
local1.* /var/log/array.log
/var/log/array.log
# cat /var/log/array.log Jan 12 00:29:29 192.168.3.20 CLI: User "array" executed cmd "show run"
防止日志文件本修改,加入某些属性。
1:chattr 命令可以使某个文件属性改变 chattr +a /var/log/array.log 只允许追加,不允许减少。 chattr -a /var/log/array.log 去掉属性。 2:lsattr 命令查看chattr属性 # lsattr /var/log/array.log -----a------- /var/log/array.log
原文出处:Netkiller 系列 手札
本文作者:陈景峯
转载请与作者联系,同时请务必标明文章原始出处和作者信息及本声明。