2.14. Syslog Commands

2.14.1. clear logging buffer

Command Purpose

To clear messages from the logging buffer, use the clear logging buffer command in Privileged EXEC mode.

Prerequisites

Platform

Software

License

Comments

AQ-N3000

7.0

Base

AQ-N5000

7.0

Base

AQ-N6000

7.0

Base

Command Syntax

clear logging buffer

Command Mode

Privileged EXEC

Default

None

Usage

Clear log messages in logging buffer

Examples

The following shows how to clear logging buffer:

Switch# clear logging buffer

2.14.2. logging alarm-trap

Command Purpose

To limit messages logged to the syslog servers based on severity, use the logging alarm-trap command in Global Config mode. To restore the default level, use the no form of this command.

Prerequisites

Platform

Software

License

Comments

AQ-N3000

7.0

Base

AQ-N5000

7.0

Base

AQ-N6000

7.0

Base

Command Syntax

logging alarm-trap (enable|disable|level (high|lower|middle|minor) )

no logging alarm-trap level

Parameter

Parameter Description

Parameter Value

enable

Enable logging traps

-

disable

Disable logging traps

-

level high

The high alarm level

-

level lower

The lower alarm level.

-

level middle

The middle alarm level

-

level minor

The minor alarm level

-

Command Mode

Global Config

Default

Logging trap is disabled.

Usage

A trap is an unsolicited message sent to a remote network management host. Logging traps should not be confused with SNMP traps.

Examples

The following shows how to limit messages logged to the log servers based on severity:

Switch# configure terminal
Switch(config)# logging alarm-trap enable
Switch(config)# logging alarm-trap level high

Related Commands

logging alarm-trap level middle

2.14.3. logging file

Command Purpose

To enable writing logs into files, use the logging file command in Global Config mode.

Prerequisites

Platform

Software

License

Comments

AQ-N3000

7.0

Base

AQ-N5000

7.0

Base

AQ-N6000

7.0

Base

Command Syntax

logging file (enable|disable)

Parameter

Parameter Description

Parameter Value

enable

Enable writing logs to file

-

disable

Disable writing logs to file

-

Command Mode

Global Config

Default

Logging file is enabled

Usage

If logging file will enabled, the log will be saved to flash:/syslog every 6 hours.

Examples

The following shows how to enable logging file function:

Switch# configure terminal
Switch(config)# logging file enable

Related Commands

show logging

2.14.4. logging level file

Command Purpose

To set severity level while writing logs into files, use the logging level file command in Global Config mode. To return the logging to the default level, use the no form of this command.

Prerequisites

Platform

Software

License

Comments

AQ-N3000

7.0

Base

AQ-N5000

7.0

Base

AQ-N6000

7.0

Base

Command Syntax

logging level file (alert|critical|debug|emergency|error|information|notice|warning|SEVERITY_LEVEL)

no logging level file

Parameter

Parameter Description

Parameter Value

0

emergency

System is unusable

1

alert

Immediate action needed

2

critical

Critical conditions

3

error

Error conditions

4

warning

Warning conditions

5

notice

Normal but significant conditions

6

information

Informational messages

7

debug

Debugging messages

SEVERITY_LEVEL

Severity level

0 - 7

Command Mode

Global Config

Default

Logging file level is inofrmation.

Usage

Specifying a severity-level causes messages only at that level and numerically lower levels to files.

Examples

In the following example, the user specifies that only messages of the levels error, critical, alerts, and emergency be logged to files:

Switch# configure terminal
Switch(config)# logging level file 3

Related Commands

logging level module

2.14.5. logging buffer

Command Purpose

To set the number of logs saved in system buffer, use the logging buffer command in Global Config mode. To return the logging to the default value, use the no form of this command.

Prerequisites

Platform

Software

License

Comments

AQ-N3000

7.0

Base

AQ-N5000

7.0

Base

AQ-N6000

7.0

Base

Command Syntax

logging buffer BUFFERSIZE

no logging buffer

Parameter

Parameter Description

Parameter Value

BUFFERSIZE

logging buffer size

10 - 1000

Command Mode

Global Config

Default

500

Usage

Specifying the max number of messages showed in CLI show logging buffer.

Examples

In the following example, the user save 1000 logging entries in system:

Switch# configure terminal
Switch(config)# logging buffer 1000

Related Commands

show logging buffer

2.14.6. logging level module

Command Purpose

To set severity level, use the logging level module command in Global Configuration mode. To return the logging to the default level, use the no form of this command.

Prerequisites

Platform

Software

License

Comments

AQ-N3000

7.0

Base

AQ-N5000

7.0

Base

AQ-N6000

7.0

Base

Command Syntax

logging level module (alert|critical|debug|emergency|error|information|notice|warning|SEVERITY_LEVEL)

no logging level module

Parameter

Parameter Description

Parameter Value

0

emergency

System is unusable

1

alert

Immediate action needed

2

critical

Critical conditions

3

error

Error conditions

4

warning

Warning conditions

5

notice

Normal but significant conditions

6

information

Informational messages

7

debug

Debugging messages

SEVERITY_LEVEL

Severity level

0 - 7

Command Mode

Global Config

Default

Logging file level is debugging.

Usage

Specifying a severity-level causes messages only at that level and numerically lower levels of the modules.

Examples

In the following example, the user specifies that all messages be logged:

Switch# configure terminal
Switch(config)# logging level module debug

Related Commands

logging level file

2.14.7. logging merge

Command Purpose

To enable the logging mergence, use the logging merge command in Global Configuration mode. To restore to default value, use the no form of this command.

Prerequisites

Platform

Software

License

Comments

AQ-N3000

7.0

Base

AQ-N5000

7.0

Base

AQ-N6000

7.0

Base

Command Syntax

logging merge (enable|disable|fifo-size SIZE|timeout SECONDS)

no logging merge (fifo-size|timeout)

Parameter

Parameter Description

Parameter Value

enable

Enable logging mergence

-

disable

Disable logging mergence

-

fifo-size SIZE

Set fifo size. The range is 100 to 10240, default value is 1024

100 - 10240

timeout SECONDS

Set timeout. The range is 1 to 300 seconds, default value is 10 seconds

1 - 300

Command Mode

Global Config

Default

Logging mergence is enabled.

Usage

The logging merge command merges all the same logs into one during a specified time range. During this time, the switch buffered these same logs. You can use the timeout keyword to set the time range, and use the fifo-size to set the buffer size.

Examples

The following shows how to enable logging merge function:

Switch# configure terminal
Switch(config)# logging merge enable

Related Commands

logging merge timeout 30

2.14.8. logging sync

Command Purpose

To synchronize log from buffer to syslog file, use the logging sync command in privileged EXEC mode.

Prerequisites

Platform

Software

License

Comments

AQ-N3000

7.0

Base

AQ-N5000

7.0

Base

AQ-N6000

7.0

Base

Command Syntax

logging sync

Command Mode

Privileged EXEC

Default

None

Usage

When enabled log merge, system will merge all the same logs into one during a specified time range. During this time log will not send to logging buffer. If user wants to sync log to logging buffer, use this command. And synchronize log from buffer to syslog file.

Examples

The following shows how to enable logging sync function:

Switch# logging sync

Related Commands

logging merge enable logging sync timeout

2.14.9. logging sync timeout

Command Purpose

To set the timeout that synchronize log from buffer to syslog file. To restore to default value, use the no form of this command.

Prerequisites

Platform

Software

License

Comments

AQ-N3000

7.0

Base

AQ-N5000

7.0

Base

AQ-N6000

7.0

Base

Command Syntax

logging sync timeout INTERVAL

no logging sync timeout

Parameter

Parameter Description

Parameter Value

INTERVAL

Sync timeout in minutes

5 - 1440

Command Mode

Global Config

Default

360 minutes

Usage

None

Examples

The following shows how to set every 5 minutes synchronize log from buffer to syslog file:

Switch# configure terminal
Switch(config)# logging sync timeout 5

Related Commands

logging sync

2.14.10. logging operate

Command Purpose

To log the operations, and use the logging operate command in Global Configuration mode.

Prerequisites

Platform

Software

License

Comments

AQ-N3000

7.0

Base

AQ-N5000

7.0

Base

AQ-N6000

7.0

Base

Command Syntax

logging operate (enable|disable)

Parameter

Parameter Description

Parameter Value

enable

Enable logging operations

-

disable

Disable logging operations

-

Command Mode

Global Config

Default

Logging operations is disabled

Usage

If logging operate is enabled, all the CLI in configure mode or higher will be save to logger buffer.

Examples

The following shows how to enable logging operate function:

Switch# configure terminal
Switch(config)# logging operate enable

Related Commands

logging server

2.14.11. logging server

Command Purpose

To enable the logging to the remote logging servers, use the logging server command in Global Config mode.

Prerequisites

Platform

Software

License

Comments

AQ-N3000

7.0

Base

AQ-N5000

7.0

Base

AQ-N6000

7.0

Base

Command Syntax

logging server (enable|disable)

Parameter

Parameter Description

Parameter Value

enable

Enable logging server

-

disable

Disable logging server

-

Command Mode

Global Config

Default

Logging operations is disabled.

Usage

This command is used to send logger to a remote server.

Examples

The following shows how to use logging server command:

Switch# configure terminal
Switch(config)# logging server enable

Related Commands

logging server severity

2.14.12. logging server address

Command Purpose

To log system messages and debug output to a remote server, use the logging server address command in Global Config mode. To remove a specified logging server from the configuration, use the no form of this command.

Prerequisites

Platform

Software

License

Comments

AQ-N3000

7.0

Base

AQ-N5000

7.0

Base

AQ-N6000

7.0

Base

Command Syntax

logging server address (mgmt-if| ) (IPV4_ADDR|IPV6_ADDR) (dest-port PORT_NUM| ) (transport (tcp|udp)| ) (source-interface IFNAME|source-ip SRC_IP_ADDR| )

no logging server address (mgmt-if| ) (IPV4_ADDR|IPV6_ADDR)

Parameter

Parameter Description

Parameter Value

mgmt-if

Management port

-

IPV4_ADDR

IPv4 address of the server that will receive the system logging messages

-

IPV6_ADDR

IPv6 address of the server that will receive the system logging messages

-

PORT_NUM

Port number

1 - 65535

tcp

Transport type is tcp

TCP

udp

Transport type is udp

UDP

IFNAME

Name of source interface

All interface type

SRC_IP_ADDR

Source IPv4 address

-

Command Mode

Global Config

Default

System logging messages are not sent to any remote server.

Usage

The logging server address command identifies a remote server (usually a device serving as a syslog server) to receive logging messages. By issuing this command more than once, you can build a list of servers that receive logging messages.

If the source interface or source IP address is specified, the packet transmit will use the related IP address as source address.

Examples

In the following example, messages are logged to a server at 209.165.202.169:

Switch# configure terminal
Switch(config)# logging server address 209.165.202.169

Related Commands

logging server

2.14.13. logging server facility

Command Purpose

To configure the syslog facility in which error messages are sent, use the logging server facility command in Global Config mode. To revert to the default of local7, use the no form of this command.

Prerequisites

Platform

Software

License

Comments

AQ-N3000

7.0

Base

AQ-N5000

7.0

Base

AQ-N6000

7.0

Base

Command Syntax

logging server facility (kern|user|mail|daemon|auth|syslog|lpr|news|uucp|cron|authpriv|ftp|FACILITY_TYPE|FACILITY_LOCAL)

no logging server facility

Parameter

Parameter Description

Parameter Value

0

kern

Kernel

1

user

User

2

mail

Mail system

3

daemon

System daemon

4

auth

Authorization system

5

syslog

System log

6

lpr

Line printer system

7

news

USENET news

8

uucp

UNIX-to-UNIX

9

cron

Cron facility

10

authpriv

Authorization priv system

11

ftp

FTP sytem

16

local0

Reserved for locally defined messages

17

local1

Reserved for locally defined messages

18

local2

Reserved for locally defined messages

19

local3

Reserved for locally defined messages

20

local4

Reserved for locally defined messages

21

local5

Reserved for locally defined messages

22

local6

Reserved for locally defined messages

23

local7

Reserved for locally defined messages

FACILITY_TYPE

system defined messages

0 - 11

FACILITY_LOCAL

Reserved for locally defined messages

6 - 23

Command Mode

Global Config

Default

Default is local4

Usage

None

Examples

The following shows how to use logging file command:

Switch# configure terminal
Switch(config)# logging server facility local3

Related Commands

logging server

2.14.14. logging server severity

Command Purpose

To set severity level while writing logs into servers, use the logging server severity command in Global Config mode. To revert to the default severity level, use the no form of this command.

Prerequisites

Platform

Software

License

Comments

AQ-N3000

7.0

Base

AQ-N5000

7.0

Base

AQ-N6000

7.0

Base

Command Syntax

logging server severity (alert|critical|debug|emergency|error|information|notice|warning|SEVERITY_LEVEL)

no logging server severity

Parameter

Parameter Description

Parameter Value

0

emergency

System is unusable

1

alert

Immediate action needed

2

critical

Critical conditions

3

error

Error conditions

4

warning

Warning conditions

5

notice

Normal but significant conditions

6

information

Informational messages

7

debug

Debugging messages

SEVERITY_LEVEL

Severity level

0 - 7

Command Mode

Global Config

Default

Logging server level is information.

Usage

This command is used to set severity level while writing logs into servers.

Examples

In the following example, the user specifies that only messages of the levels error, critical, alerts, and emergency be logged to server:

Switch# configure terminal
Switch(config)# logging server severity 3

Related Commands

logging level module

logging level file

2.14.15. logging timestamp

Command Purpose

To configure the system to apply a time-stamp to debugging messages or system logging messages, use the logging timestamps command in Global Configuration mode. To restore the default timestamp format, use the noform of this command.

Prerequisites

Platform

Software

License

Comments

AQ-N3000

7.0

Base

AQ-N5000

7.0

Base

AQ-N6000

7.0

Base

Command Syntax

logging timestamp (bsd|date|iso|none|rfc3164|rfc3339)

no logging timestamp

Parameter

Parameter Description

Parameter Value

bsd

BSD style (RFC 3164)

-

date

Date command style

-

iso

ISO style (RFC 3339)

-

none

No timestamp

-

rfc3164

RFC 3164 style (BSD)

-

rfc3339

RFC 3339 style (ISO)

-

Command Mode

Global Config

Default

Default timestamp format is BSD.

Usage

This command is used to specify the timestamp in logger message.

Examples

The following shows how to set the timestamp to ISO:

Switch# configure terminal
Switch(config)# logging timestamp iso

Related Commands

show logging

2.14.16. show logging

Command Purpose

To display the state of system logging (syslog), use the show logging command in privileged EXEC mode.

Prerequisites

Platform

Software

License

Comments

AQ-N3000

7.0

Base

AQ-N5000

7.0

Base

AQ-N6000

7.0

Base

Command Syntax

show logging

Command Mode

Privileged EXEC

Default

None

Usage

None

Examples

The following shows how to display the configuration of the log:

Switch# show logging
Current logging configuration:
============================================================
logging buffer 500
logging timestamp date
logging file enable
logging level file warning
logging level module debug
logging server disable
logging server severity warning
logging server facility local7
logging alarm-trap enable
logging alarm-trap level middle
logging merge disable
logging merge fifo-size 1024
logging merge timeout 10
logging operate disable

Related Commands

logging level

2.14.17. show logging buffer

Command Purpose

To display the contents of the standard system logging buffer, use the show logging buffer command in privileged EXEC mode.

Prerequisites

Platform

Software

License

Comments

AQ-N3000

7.0

Base

AQ-N5000

7.0

Base

AQ-N6000

7.0

Base

Command Syntax

show logging buffer (LINES|statistics| )

Parameter

Parameter Description

Parameter Value

LINES

Specify the max number of logs.positive number means latest message displayed on top, negative number means the oldest message displayed on top.

-1000 - 1000

statistics

Display statistics of logging buffers

-

Command Mode

Privileged EXEC

Default

Display 20 messages when messages number is not specified. The latest message is displayed on top

Usage

None

Examples

The following shows how to use show logging buffer command:

Switch# show logging buffer statistics
Logging buffer statistics:
============================================================
Total processed 153 entries
Total dropped 0 entries
Current have 153 entries
The latest message is:
Aug 6 16:06:44 Switch3 IMISH-6: ready to service
The oldest message is:
Aug 6 13:38:38 Switch LOGGING-5: logging starting up;
version='2.0rc4'

Related Commands

show logging