logger
Filter messages to the output, and specify the location where these messages are output
Synopsis:
logger filter[,filter,...] output_dest
Options:
- filter[,filter,...]
- Output information for the specified message types. Specify one or more types, separated by commas (see below).
- output_dest
- The output destination for the messages specified by the filters.
Specify only one output per logger instance.
Supported destinations are
stdout,stderr,slog, andnone. Note thatslogstands forsystem logger
, which is slogger2.
Description:
You may specify from zero to many logger options for a VM.
Log messages are filtered by the severity of the condition that caused a message to
be emitted. Supported message severity types are:
| Filter | Severity |
|---|---|
| fatal | A fatal error was detected; the qvm process can't continue. |
| internal | An internal error in the qvm process was detected; the process terminates right away. |
| error | An error that may or may not cause the qvm process to stop, but does indicate a problem that requires immediate attention, was detected. |
| warn | The qvm process can continue, but has encountered a problem that should be addressed. |
| info | Output information is requested by the user (e.g., in response to a SIGUSR1 signal). |
| debug | Provides information useful to QNX when debugging user-reported issues. |
| verbose | Provides users with detailed information useful for debugging their system. |
Note:
The hypervisor always sends internal error logs to the slog output destination.
Thus, logger internal slog is always on.
Using logger filters
Filters are not like verbosity levels, where each level outputs
increasingly trivial messages. Filters are combined. You must specify the filter for
every type of message you want to output. For example, specifying logger
error stderr outputs only errors. It doesn't output errors and
fatal errors. To get both, you must specify logger error,fatal
stderr.
Default configuration
If no logger option is specified in the qvm
configuration file, to ensure that all information, warning, and error-related messages
of any type are sent to
stderr, the following logger
configuration is assumed:
logger fatal,internal,error,warn,info stderrExamples:
An explicit configuration overrides the default configuration. For example:
logger error,warn,info slog
overrides the default output location (i.e., stderr), and directs
output to slog only.If you want to output to both
stderr and slog, you
must specify both output destinations separately, as follows:
logger error,warn,info slog
logger error,warn,info stderrBy default, certain log messages are directed to
stderr.
Using the none output destination tells a log filter to not log certain
messages at all:
logger info,verbose noneIn this case, the none destination is specified for
info and verbose, meaning these message types aren't logged.
In the following logger option examples, only one output destination
is specified per line:
logger warn,error,fatal stderr
logger info stdout
logger error,fatal,info,warn slog
logger error,fatal,info,warn stderr
logger internal,debug slogNote that error,fatal,info,warn is repeated to direct the
output to both slog and stderr.
Page updated:
