fix: systemd logging

This commit is contained in:
Daniel Kempkens 2023-06-06 21:43:57 +02:00
parent 5df6b01c2d
commit 2c21daf3c4
Signed by: daniel
SSH key fingerprint: SHA256:Ks/MyhQYcPRQiwMKLAKquWCdCPe3JXlb1WttgnAoSeM

View file

@ -5,6 +5,15 @@ defmodule WeewxProxy.Application do
@impl true @impl true
def start(_type, _args) do def start(_type, _args) do
_ =
case :logger.add_handlers(:systemd) do
:ok ->
:logger.remove_handler(:default)
_ ->
:logger.add_handler_filter(:default, :elixir_filter, {&:logger_filters.domain/2, {:log, :sub, [:elixir]}})
end
children = [ children = [
WeewxProxy.Mqtt, WeewxProxy.Mqtt,
WeewxProxy.Publisher, WeewxProxy.Publisher,