33.9. Logging


		
log on
		
		

33.9.1. log http

			
Array(config)#log http squid novip nohost
			
			

Apache Log combined Format

			
Array(config)#log http combined novip nohost
			
			

33.9.2. show log config

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
			

33.9.3. show log buff

			
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"
			
			

33.9.4. log host

			
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 系列 手札
本文作者:陈景峯
转载请与作者联系,同时请务必标明文章原始出处和作者信息及本声明。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值