loglevel
This command sets the criticality of events to log to the system log.
Syntax
loglevel priority
Parameters
- priority
- Specifies the type of events that are written to the system log and can be expressed as either
keyword or integer. Events are characterized in descending order of criticality. The default value
is
notice
or 5.- For emergency, enter
emerg
. - For alert, enter
alert
. - For critical, enter
critic
. - For error, enter
error
. - For warning, enter
warn
. - For notice, enter
notice
. - For information, enter
info
. - For debug, enter
debug
.
- For emergency, enter
Guidelines
The loglevel command determines which events to log to the system log. The priority also functions as a filter and determines which events to forward to a remote syslog daemon. In contrast, syslog specifies the events to forward to a remote destination.
In the absence of an argument, the loglevel command displays the current log-level.
With an argument, the loglevel command indicates that all events of greater or equal criticality to the argument are logged.
Note: Use the loglevel, logsize, and syslog
commands to configure the system log.
Examples
- Set the priority to critical, which logs critical, alert, and emergency
events.
# loglevel critical
- Set the priority to 2, which logs critical, alert, and emergency events.
# loglevel 2
- Display the current priority.
# loglevel loglevel is 7 debug