arbiter-worker-0.1.0.0: Worker framework for arbiter
Safe HaskellNone
LanguageGHC2024

Arbiter.Worker.Logger

Description

Logging for the Arbiter worker.

Arbiter handles its own structured JSON logging internally. Users can:

  • Control the minimum log level
  • Choose the output destination (stdout, stderr, custom LoggerSet, or callback)
  • Provide a LogCallback to receive pre-rendered JSON log lines
  • Inject additional context (e.g., trace IDs) into every log message

For application-level job logging, use ObservabilityHooks instead.

Synopsis

Log Configuration

data LogConfig Source #

Configuration for Arbiter's internal logging.

Arbiter always outputs structured JSON logs. This config controls filtering, destination, and allows injecting additional context.

Constructors

LogConfig 

Fields

data LogDestination Source #

Where Arbiter writes log output.

Constructors

LogStdout

Log to stdout (default)

LogStderr

Log to stderr

LogFastLogger LoggerSet

Log to a custom fast-logger LoggerSet

LogCallback (LogLevel -> Text -> [Pair] -> IO ())

Log to a user-provided callback. The callback receives the LogLevel, the plain message Text, and all structured context as [Pair] (job info, additional context, etc.). This lets you integrate Arbiter's logs into your own structured logging stack.

let cb level msg ctx = myLogger level msg ctx
in defaultLogConfig { logDestination = LogCallback cb }
LogDiscard

Discard all logs (silent mode)

defaultLogConfig :: LogConfig Source #

Default log configuration: Info level to stdout, no additional context.

silentLogConfig :: LogConfig Source #

Silent log configuration: discards all logs.

Log Levels

data LogLevel Source #

Log severity levels.

Constructors

Debug 
Info 
Warning 
Error 

Re-exports for structured context

type Pair = (Key, Value) #

(.=) :: (KeyValue e kv, ToJSON v) => Key -> v -> kv #