The LOGGING commands allow you to configure such parameters as log storage location (local file, remote file), number and size of these files, message filtering rules.
logging console
The command allows you to set the level of syslog messages that will be displayed in the console in one of two modes: either display all messages with the level not lower than the specified one, or only with this level.
The use of a negative form (no) of the command sets the default value.
Syntax
[no] logging console <SEVERITY>
Parameters
<SEVERITY > – syslog message level for output: 'emerg', 'alert', 'crit', 'error', 'warning', 'notice', 'info', 'debug'.
Default value
info
Command mode
CONFIG
Example
ma4000(config)# logging console debug
logging file
This command specifies the name of the local file where the log is stored, as well as the level of messages that are stored in this file.
The use of a negative form (no) of the command sets the default value.
Syntax
[no] logging file <FILE> <SEVERITY>
Parameters
<FILE> – file name, up to 255 characters long;
<SEVERITY> – level of messages, that saved in file.
Command mode
CONFIG
Example
ma4000(config)# logging file test alert
logging file-size
This command allows to set the maximum log file size in kilobytes. When one file is exhausted, the system will create the next one according to the max-files setting (see loggingmax-files).
The use of a negative form (no) of the command restores the default value.
Syntax
logging file-size <SIZE>
no logging file-size
Parameters
<SIZE> – allowed size of log file. Values between 100 and 10000 Kbytes are allowed.
Default value
500 KB
Command mode
CONFIG
Example
ma4000(config)# logging file-size 1000
logging filter
The command allows to switch to the configuration mode of a separate filter rule by its name, a detailed description of the LOGFILTER mode is given in Syslog filters configuration. LOGFILTER command mode section.
The use of the negative form (no) of the command remove filter by its name.
Syntax
[no] logging filter <FILE>
Parameters
<FILE> – file name, up to 255 characters.
Command mode
CONFIG
Example
ma4000(config)# logging filter test ma4000(pp4x-config-log-filter-test)#
logging builtin-filter
The command allows to switch to the configuration mode of the filter rule of a predefined slot.
Syntax
logging builtin-filter <NAME>
Parameters
<NAME> – slot name or PP4X card, may take values: 'pp', 'pp-other', 'slot0', 'slot1', 'slot2', 'slot3', 'slot4', 'slot5', 'slot6', 'slot7', 'slot8', 'slot9', 'slot10', 'slot11', 'slot12', 'slot13', 'slot14', 'slot15'.
Command mode
CONFIG
Example
ma4000(config)# logging builtin-filter pp ma4000(pp4x-config-log-filter-pp)#
logging host
This command allows to set the mode of log saving to a remote address.
The use of a negative form (no) of the command cancels the remote logging.
Syntax
logging host <HOST> port <PORT> transport <TRANSPORT> <SEVERITY>
no logging host
Parameters
<HOST> – IP address of the remote host to save the log file;
<PORT> – port number for communication with the remote host from 1 to 65535;
<TRANSPORT> – transmission packets type: tcp or udp;
<SEVERITY> – level of messages, that saved in file.
Command mode
CONFIG
Example
ma4000(config)# logging host 192.168.1.2 port 1024 transport tcp debug
logging max-files
This command specifies the maximum number of log-files to be stored in the system. When the last available one is filled in, the system will go back to the first one.
The use of a negative form (no) of the command returns the default value.
Syntax
logging max-files <FILE_NUM>
no logging max-files
Parameters
<FILE_NUM> – maximum log file number, may take values [1 .. 1000].
Default value
3
Command mode
CONFIG
Example
ma4000(config)# logging max-files 20
logging storage persistent
The command allows to specify the mode of saving log-files in memory. Log files will either be created from scratch every time you start the MA4000, or saved between restarts.
The use of a negative form (no) of the command returns the storage mode to temporary.
Syntax
[no] logging storage persistent
Parameters
The command contains no arguments.
Command mode
CONFIG
Example
ma4000(config)# logging storage persistent
logging monitor
The command allows to set the level of SYSLOG messages that will be displayed at remote SSH and TELNET sessions in one of two modes: either display all messages with the level not lower than the specified one, or only with this level.
The use of a negative form (no) of the command removes a set mode.
Syntax
logging monitor <SEVERITY>
no logging monitor
Parameters
<SEVERITY > – syslog message level for output: 'emerg', 'alert', 'crit', 'error', 'warning', 'notice', 'info', 'debug'.
Default value
info
Command mode
CONFIG
Example
ma4000(config)# logging monitor debug
clear log
This command allows to delete log-files stored in local memory of MA4000-PX.
Syntax
clear log [file <FILE>]
Parameters
<FILE> – log file name to delete, optional . If file name is not specified, all log files stored in local device memory will be deleted.
Command mode
ROOT
Example
ma4000# clear log file slot0
show log
This command allows to view the list of log files stored in local memory of MA4000-PX. If file name is specified, the content of the log file will be displayed.
Syntax
show log [<FILE>]
Parameters
<FILE> – log file name, optional.
Command mode
ROOT
Example
ma4000# showlog Log files ~~~~~~~~~ ## Name Size in bytes Date of last modification ---- -------------------- ---------------- ------------------------- 1 daemon 447 Tue Feb 4 12:01:39 2014 2 pp 188073 Tue Feb 4 12:01:39 2014 3 slot0 6132 Tue Feb 4 12:03:41 2014 4 slot0.1 511983 Tue Feb 4 09:23:56 2014 5 slot0.2 511867 Tue Feb 4 09:23:56 2014 6 slot0.3 511915 Tue Feb 4 09:23:56 2014 ---- -------------------- ---------------- ------------------------- Total files: 6
show logging config
This command allows to view log settings for saving MA4000 log files.
Syntax
show logging config
Parameters
The command contains no arguments.
Command mode
ROOT
Example
ma4000# show logging config Logging max files – 3 Logging file size – 500 Criteria filter table: ~~~~~~~~~~~~~~~~~~~~~~ Name Emerg Alert Crit Error Warn Notce Info Debug --------------- ----- ----- ----- ----- ----- ----- ----- ----- console + + + + + + – – monitor + + + + + + + + + + + + + + – – slot0 + + + + + + + – slot1 + + + + + + + – slot2 + + + + + + + – slot3 + + + + + + + – slot4 + + + + + + + – slot5 + + + + + + + – slot6 + + + + + + + – slot7 + + + + + + + – slot8 + + + + + + + – slot9 + + + + + + + – slot10 + + + + + + + – slot11 + + + + + + + – slot12 + + + + + + + – slot13 + + + + + + + – slot14 + + + + + + + – slot15 + + + + + + + – pp + + + + + + + – pp-other + + + + + + + – File target table: ~~~~~~~~~~~~~~~~~~ Filter name File name -------------------- ------------------------------------------------------------ slot0 slot0 slot1 slot1 slot2 slot2 slot3 slot3 slot4 slot4 slot5 slot5 slot6 slot6 slot7 slot7 slot8 slot8 slot9 slot9 slot10 slot10 slot11 slot11 slot12 slot12 slot13 slot13 slot14 slot14 slot15 slot15 pp pp pp-other pp-other load-1-3-2_51#