Logger.Backend.Humio (logger_humio_backend v0.2.2) View Source

A Genserver that receives calls and events from Elixir when configured as a logger.

Link to this section Summary

Functions

The logger can be (re-)configured at runtime by calling :configure. There currently isn't any logic for merging the existing config and the new options, so if you use this, set all the options that are relevant to you. Also batched log lines are lost when the logger is re-configured at runtime.list()

Send batched events when Logger.flush/0 is called.

Unhandled messages are simply ignored.

Link to this section Types

Specs

log_event() :: %{
  level: atom(),
  message: String.t(),
  timestamp: any(),
  metadata: keyword()
}

Specs

state() :: %{
  log_events: [log_event()],
  config: %{
    token: String.t(),
    host: String.t(),
    name: any(),
    ingest_api: Logger.Backend.Humio.IngestApi,
    client: Logger.Backend.Humio.Client,
    level: Logger.level(),
    format: any(),
    metadata: keyword() | :all | {:except, keyword()},
    max_batch_size: pos_integer(),
    flush_interval_ms: pos_integer(),
    debug_io_device: atom() | pid(),
    fields: map(),
    tags: map()
  },
  flush_timer: reference()
}

Link to this section Functions

Link to this function

handle_call(arg1, state)

View Source

The logger can be (re-)configured at runtime by calling :configure. There currently isn't any logic for merging the existing config and the new options, so if you use this, set all the options that are relevant to you. Also batched log lines are lost when the logger is re-configured at runtime.list()

Will eventually be improved.

Use at your own risk.

Link to this function

handle_event(arg1, state)

View Source

Send batched events when Logger.flush/0 is called.

Link to this function

handle_info(arg1, state)

View Source

Unhandled messages are simply ignored.