Oban.Telemetry.attach_default_logger

You're seeing just the function attach_default_logger, go back to Oban.Telemetry module for more information.
Link to this function

attach_default_logger(level \\ :info)

View Source (since 0.4.0)

Specs

attach_default_logger(Logger.level()) :: :ok | {:error, :already_exists}

Attaches a default structured JSON Telemetry handler for logging.

This function attaches a handler that outputs logs with the following fields:

  • args — a map of the job's raw arguments
  • duration — the job's runtime duration, in the native time unit
  • event — either :success or :failure depending on whether the job succeeded or errored
  • queue — the job's queue
  • source — always "oban"
  • system_time — when the job started, in microseconds
  • worker — the job's worker module

Examples

Attach a logger at the default :info level:

:ok = Oban.Telemetry.attach_default_logger()

Attach a logger at the :debug level:

:ok = Oban.Telemetry.attach_default_logger(:debug)