There are 2 problems I see:
- not all backends will support formatting, for example there is no point
in having formatter in case of JSON backend, as you can provide structure
that is order independent
- we should begin slow move towards deprecating `:logger` application
(Elixir one) and instead promote `:logger` module (Erlang's `kernel`
module) as this has more features (all syslog levels, structured logging)
and will be the next standard in OTP world
W dniu czwartek, 21 marca 2019 13:38:24 UTC+1 użytkownik Joe ARO napisał:
>
> Hi there,
>
> so i don't think this is possible but feel free to tell me otherwise, id
> love to be able to do something like this:
>
> #config.exs
> config :logger, format:"foobar"
>
> and have that applied to all of my logger backends currently I am having
> to specify the format for each of my backends like so:
>
> #config.exs
> config :logger, :console, format: "$message\n"
>
> #prod.exs
> config :logger,
> backends: [{LoggerFileBackend, :file}]
>
> config :logger, :file,
> path: "/var/log/component/error.log",
> format: "$message\n",
> level: :error
>
> Apologies if this is something I have overlooked, but if not I think this
> would be a great feature.
>
> Thanks,
> Joe
>
--
You received this message because you are subscribed to the Google Groups
"elixir-lang-core" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/elixir-lang-core/74b9c452-c8e7-4073-b2c2-afc60b946d4c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.