log_forwarder v0.1.0 LogForwader View Source

A simple LogForwarder backend which run as a supervisor to forward logs to another server.

Link to this section Summary

Functions

Returns a specification to start this module under a supervisor

Callback invoked to start the supervisor and during hot code upgrades

Link to this section Functions

Returns a specification to start this module under a supervisor.

See Supervisor.

Callback invoked to start the supervisor and during hot code upgrades.

Developers typically invoke Supervisor.init/2 at the end of their init callback to return the proper supervision flags.

Callback implementation for Supervisor.init/1.

Link to this function send_log(tag, level, data) View Source
send_log(tag :: binary(), level :: Atom.t(), data :: Map.t()) ::
  {:ok, pid()} | nil

Send log

Parameters:

ParamDescriptionExample
tagTag of logAPI, Auth, …
levelLog level:info or :error
dataLog data%{user_id: 123, function_name: 'Client.sample_func', ...}

Examples

iex> LogForwarder.send_log('API', :info, data)