A simple LogForwarder
backend as a supervisor which forwards logs to another server.
def deps do
[
{:log_forwarder, "~> 0.2.2"}
]
end
Our config.exs would have an entry similar to this:
config :log_forwarder, config:
host: "localhost",
port: 24224,
prefix: "LogForwarder",
retry_times: 10,
attributes: ~w(level error ...)
LogForwarder
supports the following configuration values:
- host
- port
- prefix
- retry_times
- attributes
defmodule SampleModule do
import LogForwarder
def sample_func() do
# do something ...
send_log("api_tag", :info, data)
end
end
- Add unit test