This library enables Elixir applications to log to the Windows Event Log, using the Logger
interface. It makes use of Rust's winlog crate. Docs can be found at https://hexdocs.pm/ex_winlog.
Since this library uses Rustler
, you must have Rust installed on the machine when compiling.
def deps do
[
{:ex_winlog, "~> 0.1"}
]
end
Since ExWinlog
is a Logger
backend, you can add it to your list of backends in your config.exs
file like this:
config :logger,
backends: [:console, {ExWinlog, "My Event Source Name"}]
The ExWinlog
backend requires that the event source, "My Event Source Name"
in the example, is registered with Windows Event Viewer. Use ExWinlog.register/1
and ExWinlog.deregister/1
, while running the application as an administrator, to manage the sources. This should typically be done once when installing or uninstalling the application.