(以下总结参考了思科 Release 12.2(46)SG版本说明书)
一、日志等级及格式
注:Level 数字越小越严重
格式列举,例如:
*Nov 29 02:18:03.503 GMT: %DHCPD-4-PING_CONFLICT: DHCP address conflict: server pinged 10.39.2.17
*Nov 29 02:18:03.503为日期
%DHCPD-4-PING_CONFLICT为报错的功能模块,4代表level等级
DHCP address conflict: server pinged 10.3
二、Default System Message Logging Configuration
三、配置日志
1、日志进程开关
2、调整日志缓存区大小及远程会话显示日志
eg:
# config ter
# logging buffered [size]
# end
# terminal moniter (只对当前会话窗口有效)
3、同步日志消息
将不请自来的日志信息与当前操作进行区分,不请自来的日志输出完继续进行提示当前操作
config ter
line [console | vty] line-number[ending-line-number
logging synchronous [level [severity-level | all] | limitnumber-of-buffers]
end
4、日志添加本地时间戳及微秒
service timestamps debug datetime msec localtime #debug时间戳
service timestamps log datetime msec localtime #log时间戳
5、定义输出消息的严重级别
config ter
#By default, the console receives debugging messages and numerically lower levels
logging console [level]
#By default, the console receives debugging messages and numerically lower levels
logging monitor [level]
#By default, syslog servers receive informational messages and numerically lower levels
logging trap [level]
end
(若有不完善的地方还请各位大神指教)