Skip to content

add support settings to specify multiple logging levels#549

Open
dong50252409 wants to merge 1 commit intoerlang-lager:masterfrom
dong50252409:master
Open

add support settings to specify multiple logging levels#549
dong50252409 wants to merge 1 commit intoerlang-lager:masterfrom
dong50252409:master

Conversation

@dong50252409
Copy link
Copy Markdown

@dong50252409 dong50252409 commented Mar 23, 2021

multiple log levels are supported for setting, like to
{lager_file_backend, {file, "info.log"}, {level, [debug, error, notice]} }
here's the issues #548

@dong50252409
Copy link
Copy Markdown
Author

The logging level can be specified this way in the configuration

{handlers, [
    {lager_console_backend,[
        {level, debug}          % Outputs all log levels to the console
    ]},
    {lager_file_backend, [
        {file, "info.log"},     % The info.log file only records logs at the levels of DEBUG, INFO, NOTICE, AND WARNING
        {level, [debug, info, notice, warning]}  
    ]},
    {lager_file_backend, [
        {file, "error.log"},    % The error.log records contains all logging levels above ERROR
        {level, error}
    ]}
]}.

You can also set the log level you want to view in the console like this

lager:set_loglevel(lager_console_backend, [info, notice]).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant