Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add support settings to specify multiple logging levels #549

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

dong50252409
Copy link

@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
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