Skip to content

Logger config #2943

@MarkoMin

Description

@MarkoMin

Following an Logger example I noticed that basic alternation of default handler doesn't seem to work in combination with rebar3 shell:

[{kernel,
  [{logger,
    [{handler, default, logger_std_h,
      #{config => #{file => "path/to/file.log"}}}]}]}].

This gives no result, configuration is not applied.

When I call erl -config config/sys.config the configuration is applied as it should be. Even after I call logger:reconfigure/0, the configuration stays the same. However, when I do rebar3 shell with the same sys config file, it seems to be ignored. What is weird is that if I slightly modify the config by first setting default handler to undefined, then it works:

[{kernel,
  [{logger,
    [{handler, default, undefined},
     {handler, default, logger_std_h,
      #{config => #{file => "path/to/file.log"}}}]}]}].

The behavior seems to be specific only for the default handler.

Using Rebar 3.24.0 with OTP 27.1.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions