await io.logger.error("This is a log error message", {
  payload,
});

There are 5 levels, that you can use to log messages.

From least to most important:

  1. io.logger.debug() - info for debugging purposes
  2. io.logger.info() - information
  3. io.logger.warn() - warnings
  4. io.logger.error() - errors
  5. io.logger.log() - essential messages

If you set the logLevel on the Job or Client so only messages of a certain level are logged, then io.logger will ignore log messages of lower levels.

Parameters

Each of the io.logger methods takes these params:

message
string
required

The log message.

properties
object

An optional object with additional data to log.

Returns

A Promise that resolves when the message has been logged.

Was this page helpful?