思科关闭日志_关于思科交换机的日志配置总结

本文总结了思科交换机的日志配置,包括日志等级及其格式、默认系统消息日志配置、如何开启和调整日志进程、同步日志消息的方法以及添加本地时间戳的设置。此外,还讲解了定义输出消息严重级别的步骤。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

(以下总结参考了思科 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

(若有不完善的地方还请各位大神指教)

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值