ScoutApm.Logging.LogHandler (scout_apm v2.0.0)
Copy MarkdownErlang :logger handler for capturing log events and sending them to OTLP.
This handler runs in the client process (the process that calls Logger), which allows us to directly access Scout APM context from the process dictionary.
Usage
# Attach the handler
ScoutApm.Logging.LogHandler.attach()
# Detach the handler
ScoutApm.Logging.LogHandler.detach()Configuration
The handler respects the following config options:
:logs_enabled- Must be true for handler to process logs:logs_level- Minimum level to capture (default: :info):logs_filter_modules- List of modules to exclude from capture
Summary
Functions
Attaches the log handler to the Erlang :logger system. Returns :ok on success, {:error, reason} on failure.
Checks if the handler is currently attached.
Detaches the log handler from the Erlang :logger system.
Returns the handler ID used for registration.
Functions
Attaches the log handler to the Erlang :logger system. Returns :ok on success, {:error, reason} on failure.
@spec attached?() :: boolean()
Checks if the handler is currently attached.
@spec detach() :: :ok | {:error, term()}
Detaches the log handler from the Erlang :logger system.
@spec handler_id() :: atom()
Returns the handler ID used for registration.