CLI: Logging
You can use the logging
command to configure logging parameters and to show the system logs. You can use the show log
command to view the logs files. The appliance logs activities to a set of system log files.
Configuring logging parameters
logging {files|local|receive|fields|format|level|trap|<hostname or IPInternet protocol-address>}
To specify when to rotate the log files:
logging files rotation {criteria {frequency|size|size-pct} | force}
rotation criteria frequency {daily|weekly|monthly}
- Rotate log files on a fixed schedule.
daily
- Once per day at midnight.weekly
- Once per weekmonthly
- On the first day of every month
rotation criteria size <megabytes>
- Rotate the log files when the log file surpasses a specified size threshold.rotation criteria size-pct <percentage>
- Rotate the logs when they surpass a specified percentage of the disk size.rotation force
- Force an immediate rotation of the log files.
To specify the maximum number of old log files to keep:
logging files rotation max-num <number>
To delete log files:
logging files delete {current|oldest}
delete current
- Delete the current active log filedelete oldest [<number>]
- Delete one or more of the oldest log files. If deleting more than one file, specify the number of files to delete.
To specify the minimum severity level of log messages saved on the local disk:
logging local {none|emerg|alert|crit|err|}warning|notice|info|debug|override}
none
- Disable loggingemerg
- Emergency: system is unstablealert
- Action must be taken immediatelycrit
- Critical conditionserr
- Error conditionswarning
- Warning conditionsnotice
- Normal but significant conditionsinfo
- Informational messagesdebug
- Debug-level messagesoverride class <class> priority
- Override log levels on a per-class basis
To allow syslog messages to be received from remote hosts:
logging receive
To include the number of seconds since the epoch in the logs:
logging fields seconds {enable|fractional-digits|whole-digits}
seconds enable
- Enable the seconds fieldseconds fractional-digits {1|2|3|6}
- Specify the number of digits to the right of the decimal point (truncation is from the right)seconds whole-digits {1|6|all}
- Specify the number of digits the left of the decimal point (truncation is from the left)
all
- Do not limit the number of digits.
To set the format of the log files:
logging format {standard|welf}
format standard
- Use the standard format for log messageswelf
- Use WELF format for log messages
To set the severity of log entries recorded for select CLICommnad line interface commands:
logging level cli commands {none|emerg|alert|crit|err|warning|notice|info|debug}
none
- Disable loggingemerg
- Emergency: system is unstablealert
- Action must be taken immediatelycrit
- Critical conditionserr
- Error conditionswarning
- Warning conditionsnotice
- Normal but significant conditionsinfo
- Informational messagesdebug
- Debug-level messages
To send event logs to a specified server using the syslog protocol:
logging <hostname or IPv4 address>
Set the minimum severity of log messages sent to syslog servers:
logging trap {none|emerg|alert|crit|err|warning|notice|info|debug}
none
- Disable loggingemerg
- Emergency: system is unstablealert
- Action must be taken immediatelycrit
- Critical conditionserr
- Error conditionswarning
- Warning conditionsnotice
- Normal but significant conditionsinfo
- Informational messagesdebug
- Debug-level messages
Viewing log files
To view the log file:
show log [continuous] {matching|not matchin} <regex>
show log
- Show entire log filecontinuous
- Show the log file as it gets updatedmatching <regex>
- Show event logs that match a given regular expressionnot matching <regex>
- Show event logs that do not match a given regular expression
To view a listing of archived files:
show log files
To view the contents of a log file:
show log files <file number> [{matching| not matching} <regex>]
<file number>
- The number that identifies the log filematching <regex>
- View entries from the selected log file that matches a given regular expressionnot matching <regex>
- View entries from the selected log file that does not match a given regular expression