Monitor
To print logging events to the terminal, set the modules or events you wish to print to the terminal. For example, run: o–
switch (config) # logging monitor events notice
switch (config) # logging monitor sx-sdk warning
These commands print system events in severity “notice”, and “sx-sdk” module notifications in severity “warning” to the screen. For example, in case of interface-down event, the following gets printed to the screen:
switch (config) #
Wed Jul 10 11:30:42 2013: Interface IB1/17 changed state to DOWN
Wed Jul 10 11:30:43 2013: Interface IB1/18 changed state to DOWN
To see a list of the events, refer to “Supported Event Notifications and MIB Mapping”.
Remote Logging
To configure remote syslog to send syslog messages to a remote syslog server:
-
Set remote syslog server.
switch (config) # logging <IP address/hostname> -
(Optional) Set the destination port of the remote host.
switch (config) # logging <IP address/hostname> port <port> -
(Optional) Filter log messages according to an input regex.
switch (config) # logging <IP address/hostname> filter <include/exclude> <regex> -
Set the minimum severity of the log level to info.
switch (config) # logging <IP address/hostname> trap info -
Override the log levels on a per-class basis.
switch (config) # logging <IP address/hostname> trap override class <class name> priority <level>
Logging Protocol
A feature that provides the ability to choose the protocol to use for sending syslog messages to a remote host: UDP (default) or TCP. See "Logging | id (8.2 3.12.6000)Logging loggingprotocol" command.
Logging Commands
logging
|
|
logging <IPv4 address/IPv6 address/hostname>
Sends log messages to the remote host specified by its IP or hostname.
|
|
|
Syntax Description |
N/A |
|
|
Default |
N/A |
|
|
Configuration Mode |
config |
|
|
History |
3.1.1000 |
|
|
Role |
admin |
|
|
Example |
switch (config) # logging 1.1.1.1 switch (config) # no logging 1.1.1.1 |
|
|
Related Commands |
|
|
|
Notes |
This command is configurable. If “configuration write” is executed, the remote host will still receive messages after reload. |
|
logging port
|
|
logging <syslog IPv4 address/IPv6 address/hostname> port <destination-port>
Configures remote server destination port for log messages.
|
|
|
Syntax Description |
destination-port |
Range: 1-65535 |
|
Hostname |
Max 64 characters |
|
|
Default |
514 (UDP) |
|
|
Configuration Mode |
config |
|
|
History |
3.6.2002
|
|
|
Example |
switch (config) # logging 10.0.0.1 port 105 |
|
|
Related Commands |
logging <syslog IPv4 address/IPv6 address/hostname> trap |
|
|
Notes |
||
logging trap
|
|
logging <syslog IPv4 address/IPv6 address/hostname> [trap {<log-level> | override class <class> priority <log-level>}]
Enables (by setting the syslog IPv4 address/IPv6 address/hostname) sending logging messages, with ability to filter the logging messages according to their classes.
|
|
|
Syntax Description |
syslog IPv4 address/IPv6 address/hostname |
syslog IPv4 address/IPv6 address/hostname of the remote syslog server
|
|
log-level |
|
|
|
class |
Sets or removes a per-class override on the logging level. All classes which do not have an override set will use the global logging level set with “logging local <log level>”. Classes that do have an override will do as the override specifies. If “none” is specified for the log level, the software will not log anything from this class. Classes available:
|
|
|
Default |
Remote logging is disabled |
|
|
Configuration Mode |
config |
|
|
History |
3.6.2002
|
|
|
Example |
switch (config) # logging local info |
|
|
Related Commands |
show logging
|
|
|
Notes |
||
logging debug-files
|
|
logging debug-files {delete {current | oldest} | rotation {criteria | force | max-num} | update {<number> | current} | upload <log-file> <upload URL>}
Configures settings for debug log files.
|
|
|
Syntax Description |
delete {current | oldest} |
Deletes certain debug-log files.
|
|
rotation {criteria {frequency {daily | weekly | monthly} | size <size> | size-pct <percentage>} | force | max-num} |
Configures automatic rotation of debug-logging files.
|
|
|
update {<number> | current} |
Uploads a local debug-log file to a remote host.
|
|
|
upload |
Uploads debug log file to a remote host |
|
|
log-file |
Possible values: 1-7, or current |
|
|
upload URL |
Supported formats: HTTP, HTTPS, FTP, TFTP, SCP and SFTP (e.g.: scp://username[:password]@hostname/path/filename) |
|
|
Default |
N/A |
|
|
Configuration Mode |
config |
|
|
History |
3.3.4150
|
|
|
Example |
switch (config) # logging debug-files delete current |
|
|
Related Commands |
|
|
|
Notes |
|
|
logging fields
|
|
logging fields seconds {enable | fractional-digits <f-digit> | whole-digits <w-digit>}
Specifies whether to include an additional field in each log message that shows the number of seconds since the Epoch or not.
|
|
|
Syntax Description
|
enable |
Specifies whether to include an additional field in each log message that shows the number of seconds since the Epoch or not. |
|
f-digit |
The fractional-digits parameter controls the number of digits to the right of the decimal point. Truncation is done from the right.
|
|
|
w-digit |
The whole-digits parameter controls the number of digits to the left of the decimal point. Truncation is done from the left. Except for the year, all of these digits are redundant with syslog's own date and time.
|
|
|
Default |
Disabled |
|
|
Configuration Mode |
config |
|
|
History |
3.1.0000
|
|
|
Example |
switch (config) # logging fields seconds enable |
|
|
Related Commands |
show logging |
|
|
Notes |
This is independent of the standard syslog date and time at the beginning of each message in the format of “July 15 18:00:00”. Aside from indicating the year at full precision, its main purpose is to provide subsecond precision. |
|
logging files delete
|
|
logging files delete {current | oldest [<number of files>]} Deletes the current or oldest log files. |
|
|
Syntax Description |
current |
Deletes current log file |
|
oldest |
Deletes oldest log file |
|
|
number of files |
Sets the number of files to be deleted |
|
|
Default |
CLI commands and audit message are set to notice logging level |
|
|
Configuration Mode |
config |
|
|
History |
3.1.0000 |
|
|
Example |
switch (config) # logging files delete current |
|
|
Related Commands |
show logging
|
|
|
Notes |
|
|
logging files rotation
|
|
logging files rotation {criteria {frequency <freq> | size <size-mb>| size-pct <size-percentage>} | force | max-number <number-of-files>}
Sets the rotation criteria of the logging files.
|
|
|
Syntax Description |
freq |
Sets rotation criteria according to time. Possible options are:
|
|
size-mb |
Sets rotation criteria according to size in megabytes
|
|
|
size-percentage |
Sets rotation criteria according to size in percentage of the partition where the logging files are kept in. The percentage given is truncated to three decimal points (thousandths of a percent). |
|
|
force |
Forces an immediate rotation of the log files. This does not affect the schedule of auto-rotation if it was done based on time: the next automatic rotation will still occur at the same time for which it was previously scheduled. Naturally, if the auto-rotation was based on size, this will delay it somewhat as it reduces the size of the active log file to zero. |
|
|
number-of-files |
The number of log files will be kept. If the number of log files ever exceeds this number (either at rotation time, or when this setting is lowered), the system will delete as many files as necessary to bring it down to this number, starting with the oldest. |
|
|
Default |
10 files are kept by default with rotation criteria of 5% of the log partition size |
|
|
Configuration Mode |
config |
|
|
History |
3.1.0000
|
|
|
Example |
switch (config) # logging files rotation criteria size-pct 6 |
|
|
Related Commands |
show logging
|
|
|
Notes |
|
|
logging files upload
|
|
logging files upload {current | <file-number>} <url> Uploads a log file to a remote host. |
|
|
Syntax Description |
current |
The current log file. The current log file will have the name “messages” if you do not specify a new name for it in the upload URL. |
|
file-number |
An archived log file. The archived log file will have the name “messages<n>.gz” (while “n” is the file number) if you do not specify a new name for it in the upload URL. The file will be compressed with gzip. |
|
|
url |
Uploads URL path. Supported formats: FTP, TFTP, SCP, and SFTP. For example: scp://username[:password]@hostname/path/filename. |
|
|
Default |
10 files are kept by default with rotation criteria of 5% of the log partition size |
|
|
Configuration Mode |
config |
|
|
History |
3.1.0000 |
|
|
Example |
switch (config) # logging files upload 1 scp://admin@scpserver |
|
|
Related Commands |
show logging
|
|
|
Notes |
|
|
logging filter include
|
|
logging <IP address\hostname> filter include <regex> Sends only log messages that match the input regex to a remote host specified by its IP or hostname. |
|
|
Syntax Description |
N/A |
|
|
Default |
N/A |
|
|
Configuration Mode |
config |
|
|
History |
3.8.2000 |
|
|
Role |
admin |
|
|
Example |
switch (config) # logging 1.1.1.1 filter include ERROR |
|
|
Related Commands |
loggin no logging |
|
|
Notes |
This command is configurable. If “configuration write” is executed, the remote host will still receive filtered messages after reload. |
|
logging filter exclude
|
|
logging <IP address\hostname> filter exclude <regex> Sends only log messages that do not match the input regex to a remote host specified by its IP or hostname. |
|
|
Syntax Description |
N/A |
|
|
Default |
N/A |
|
|
Configuration Mode |
config |
|
|
History |
3.8.2000 |
|
|
Role |
admin |
|
|
Example |
switch (config) # logging 1.1.1.1 filter exclude ERROR |
|
|
Related Commands |
loggin no logging |
|
|
Notes |
This command is configurable. If “configuration write” is executed, the remote host will still receive filtered messages after reload. |
|
no logging filter
|
|
no logging <IP address\hostname> filter Sends unfiltered log messages to the configured remote host. |
|
|
Syntax Description |
N/A |
|
|
Default |
N/A |
|
|
Configuration Mode |
config |
|
|
History |
3.8.2000 |
|
|
Role |
admin |
|
|
Example |
switch (config) # no logging 1.1.1.1 filter |
|
|
Related Commands |
loggin no logging |
|
|
Notes |
This command is configurable. If “configuration write” is executed, the remote host will still receive filtered messages after reload. |
|
logging format
|
|
logging format {standard | welf [fw-name <hostname>]}
Sets the format of the logging messages.
|
|
|
Syntax Description |
standard |
Standard format |
|
welf |
WebTrends Enhanced Log file (WELF) format |
|
|
hostname |
Specifies the firewall hostname that should be associated with each message logged in WELF format. If no firewall name is set, the hostname is used by default. Hostname is limited to 64 characters. |
|
|
Default |
standard |
|
|
Configuration Mode |
config |
|
|
History |
3.1.0000 |
|
|
Example |
switch (config) # logging format standard |
|
|
Related Commands |
show logging |
|
|
Notes |
|
|
logging level
|
|
logging level {cli commands <log-level> | audit mgmt <log-level>} Sets the severity level at which CLI commands or the management audit message that the user executes are logged. This includes auditing of both configuration changes and actions. |
|
|
Syntax Description |
cli commands |
Sets the severity level at which CLI commands which the user executes are logged |
|
audit mgmt |
Sets the severity level at which all network management audit messages are logged |
|
|
log-level |
|
|
|
Default |
CLI commands and audit message are set to notice logging level |
|
|
Configuration Mode |
config |
|
|
History |
3.1.0000 |
|
|
Example |
switch (config) # logging level cli commands info |
|
|
Related Commands |
show logging |
|
|
Notes |
|
|
logging local override
|
|
logging local override [class <class> priority <log-level>]
Enables class-specific overrides to the local log level.
|
|
|
Syntax Description |
override |
Enables class-specific overrides to the local log level. |
|
class |
Sets or removes a per-class override on the logging level. All classes which do not have an override set will use the global logging level set with “logging local <log level>”. Classes that do have an override will do as the override specifies. If “none” is specified for the log level, the software will not log anything from this class. Classes available:
|
|
|
log-level |
|
|
|
Default |
Override is disabled |
|
|
Configuration Mode |
config |
|
|
History |
3.1.0000
|
|
|
Example |
switch (config) # logging local override class mgmt-front priority warning |
|
|
Related Commands |
show logging
|
|
|
Notes |
|
|
logging monitor
|
|
logging monitor <facility> <priority-level>
Sets monitor log facility and level to print to the terminal.
|
|
|
Syntax Description |
facility |
|
|
priority-level |
|
|
|
Default |
no logging monitor |
|
|
Configuration Mode |
config |
|
|
History |
3.3.4000 |
|
|
Example |
switch (config) # logging monitor events notice |
|
|
Related Commands |
|
|
|
Notes |
|
|
logging protocol
|
|
logging <IP address\hostname> protocol [tcp|udp]
Sends log messages to specified host with the chosen protocol (TCP or UDP).
|
|
|
Syntax Description |
tcp |
Sets protocol to TCP |
|
udp |
Sets protocol to UDP |
|
|
Default |
UDP |
|
|
Configuration Mode |
Configure terminal |
|
|
History |
3.8.2100 |
|
|
Role |
Admin |
|
|
Example |
switch (config) # logging 1.1.1.1 protocol tcp switch (config) # no logging 1.1.1.1 protocol |
|
|
Related Commands |
|
|
|
Notes |
This command is configurable, so if “configuration write” is executed then after reboot the remote host will still receive messages with the configured protocol. |
|
logging receive
|
|
logging receive
Enables receiving logging messages from a remote host.
|
|
|
Syntax Description |
N/A |
|
|
Default |
Receiving logging is disabled |
|
|
Configuration Mode |
config |
|
|
History |
3.1.0000 |
|
|
Example |
switch (config) # logging receive |
|
|
Related Commands |
show logging
|
|
|
Notes |
|
|
logging facility
|
|
logging facility [facility value]
Override the facility value for all remote messages.
|
|
|
Syntax Description |
facility value |
Options:
|
|
Default |
Override logging facility is disabled |
|
|
Configuration Mode |
config |
|
|
History |
3.12.4000 |
|
|
Example |
switch (config) # logging facility local5 |
|
|
Related Commands |
show logging
|
|
|
Notes |
This feature is used on the system that is sending the logs to remote in order to override the facility value to the user configured value. |
|
logging mac masking
|
|
logging mac masking
Enables MAC address masking in logs.
|
|
|
Syntax Description |
N/A |
|
|
Default |
Enabled |
|
|
Configuration Mode |
config |
|
|
History |
3.9.0900 |
|
|
Example |
switch (config) # logging mac masking |
|
|
Related Commands |
show logging |
|
|
Notes |
If enabled, the first 2 bytes of MAC address output log will be masked. For example, 00:12:34:56:78:9a will be displayed as **:**:34:56:78:9a. |
|
show log
|
|
show log [continuous | files [<file-number>]] [[not] matching <reg-exp>] Displays the log file with optional filter criteria. |
|
|
Syntax Description |
continues |
Displays the last few lines of the current log file and then continues to display new lines as they come in until the user hits Ctrl+C, similar to LINUX “tail” utility |
|
files |
Displays the list of log files |
|
|
<file-number> |
Displays an archived log file, where the number may range from 1 up to the number of archived log files available |
|
|
[not] matching <reg-exp> |
The file is piped through a LINUX “grep” utility to only include lines either matching, or not matching, the provided regular expression |
|
|
Default |
N/A |
|
|
Configuration Mode |
Any command mode |
|
|
History
|
3.1.0000
|
|
|
Example |
||
|
switch (config) # show log matching "Executing|Action" Jul 31 16:11:23 M2100-aj cli[26502]: [cli.NOTICE]: user : Executing command: enableJul 31 16:11:24 M2100-aj cli[26507]: [cli.NOTICE]: user : Executing command: enableJul 31 16:11:29 M2100-aj cli[26514]: [cli.NOTICE]: user : Executing command: enableJul 31 16:11:29 M2100-aj cli[26514]: [cli.NOTICE]: user : Executing command: show licenseJul 31 16:11:41 M2100-aj cli[26548]: [cli.NOTICE]: user : Executing command: enableJul 31 16:11:42 M2100-aj cli[26553]: [cli.NOTICE]: user : Executing command: enableJul 31 16:11:42 M2100-aj cli[26553]: [cli.NOTICE]: user : Executing command: conf termina |
||
|
Related Commands |
logging fields
|
|
|
Notes |
|
|
show logging
|
|
show logging Displays the logging configurations. |
|
|
Syntax Description |
N/A |
|
|
Default |
N/A |
|
|
Configuration Mode |
Any command mode |
|
|
History |
3.1.0000
3.12.4000: Updated example with logging facility field
|
|
|
Role |
Admin |
|
|
Example |
switch (config) # show logging Local logging level : noticeOverride for class debug-module : noticeDefault remote logging level : noticeAllow receiving of messages from remote hosts: noNumber of archived log files to keep : 10Log rotation size threshold : 19.07 megabytesLog rotation (debug) size threshold : 19.07 megabytesLog format : standardSubsecond timestamp field : disabledMAC address masking : enabledOverride Remote logging facility value : no
Levels at which messages are logged: CLI commands : notice Audit messages: notice
Remote syslog servers: 1.1.1.1: log level : notice Remote port : 514 Filter [include] regex: err
1.2.2.3: log level : notice Remote port: 33 |
|
|
Related Commands |
logging fields
|
|
|
Notes |
|
|
show logging port
|
|
show logging port Displays the port logging configurations. |
|
|
Syntax Description |
N/A |
|
|
Default |
N/A |
|
|
Configuration Mode |
Any command mode |
|
|
History |
3.1.0000
|
|
|
Example |
switch (config) # show logging Local logging level: notice Override for class debug-module: noticeDefault remote logging level: noticeRemote syslog receiver: 1.2.3.4 (log level: notice)Remote port: 514 |
|
|
Related Commands |
logging port |
|
|
Notes |
|
|
no logging servers-all
|
|
no logging servers-all This command deletes all the configured logging servers. |
|
Syntax Description |
N/A |
|
Default |
N/A |
|
Configuration Mode |
Configure terminal |
|
History |
3.12.3014 |
|
Example |
|
|
Related Commands |
[no] logging <logging-server> |
|
Notes |
If user has a logging server called ‘servers-all’ command “no logging servers-all” will delete all the servers (not only the one called servers-all). |
Last updated: