Updated: October 28, 2024 |
Filter messages to the output, and specify the location where these messages are output
logger filter[,filter,...] output_dest
You may specify from zero to many logger options for a VM.
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. |
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.
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 stderr
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 stderr
By 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 none
In 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 slog
Note that error,fatal,info,warn is repeated to direct the output to both slog and stderr.