Optional
hideHide objects from output (but not error object).
Optional
translateTranslate the epoch time value into a human readable date and time string. This flag also can set the format string to apply when translating the date to human readable format. For a list of available pattern letters see the documentation.
yyyy-mm-dd HH:MM:ss.l o
in UTC.SYS:
prefix to translate time to the local system's timezone. Use the shortcut SYS:standard
to translate time to yyyy-mm-dd HH:MM:ss.l o
in system timezone.Optional
levelIf set to true, it will print the name of the log level as the first field in the log line.
Optional
levelDefine the key that contains the level of the log.
Optional
levelOutput the log level using the specified label.
Optional
messageThe key in the JSON object to use as the highlighted message.
Optional
singlePrint each log message on a single line (errors will still be multi-line).
Optional
timestampThe key in the JSON object to use for timestamp display.
Optional
minimumThe minimum log level to include in the output.
Optional
messageFormat output of message, e.g. {level} - {pid} will output message: INFO - 1123
Optional
colorizeIf set to true, will add color information to the formatted output message.
Optional
colorizeIf set to false while colorize
is true
, will output JSON objects without color.
Optional
crlfAppends carriage return and line feed, instead of just a line feed, to the formatted log line.
Optional
errorDefine the log keys that are associated with error like objects.
Optional
errorWhen formatting an error object, display this list of properties. The list should be a comma separated list of properties.
Optional
ignoreIgnore one or several keys. Will be overridden by the option include if include is presented.
Optional
includeInclude one or several keys.
Optional
syncMakes messaging synchronous.
Optional
destinationThe file, file descriptor, or stream to write to. Defaults to 1 (stdout).
Optional
appendOpens the file with the 'a' flag.
Optional
mkdirEnsure directory for destination file exists.
Optional
customProvides the ability to add a custom prettify function for specific log properties.
customPrettifiers
is an object, where keys are log properties that will be prettified
and value is the prettify function itself.
For example, if a log line contains a query property, you can specify a prettifier for it:
Optional
customChange the level colors to an user custom preset.
Can be a CSV string in 'level_name:color_value' format or an object. Also supports 'default' as level_name for fallback color.
Optional
useOnly use custom levels and colors (if provided); else fallback to default levels and colors.
Optional
redactControl whether the current working directory should be replaced with 'CWD' in log output
Useful for eliminating noisy parent paths that aren't relevant during debugging -- or to protect user privacy.
NOTE: Only applies to log message and errors. If you need to redact arbitrary properties you should use pino's redact
or pino-pretty's customPrettifiers
Optional
padPads levels in log string so all are the same length
pino-pretty options and additional options specific to how @foxxmd/logging uses pino-pretty