erlang-lager / lager

A logging framework for Erlang/OTP
Apache License 2.0
1.12k stars 455 forks source link

Query erlang.log creation #517

Open pankajsoni19 opened 5 years ago

pankajsoni19 commented 5 years ago

I am using lager. This is my config.

There is an erlang.log file being created in the log folder which is essentially duplicating stuff that is in debug.log. Could you tell the reason for its creation?

I am passing this in vm.args file to erlang

-sasl sasl_error_logger false
{lager, [
        {log_root, "log" },
        {crash_log, "crash.log"},
        {handlers, [
            {lager_console_backend, [
                {level, debug},
                {formatter, lager_default_formatter},
                {formatter_config, [time," [",severity,"] ", message, "\n"]}
            ]},
            {lager_file_backend, [
                {file, "debug.log"},
                {level, debug},
                {formatter, lager_default_formatter},
                {formatter_config, [date, " ", time," [",severity,"] ",pid, " ", message, "\n"]},
                {size, 2097152}, {date, "$D0"}, {count, 5}
            ]}
        ]}
    ]}
moooofly commented 4 years ago

@pankajsoni19

meet the same issue recently, wonder how you fix it

tks

pankajsoni19 commented 4 years ago

Couldn't fix it. These are 5 files, and not much of a big deal so ignored it. I just wanted to know the reason, why this was happening.

moooofly commented 4 years ago

Thanks for quick reply.

In my case, it is a real matter, because I find that there are quite many logs writen into this file

Also I find that my erlang application is not running normally, from the log output, I see some latency (somethings > 1s) happened now and then.

I can't find how to disable erlang.log

Vagabond commented 4 years ago

That's not a lager file. Your release may be logging stdout to the file, in which case you may want to try disabling the console log handler.

moooofly commented 4 years ago

@Vagabond

Thanks for your tips, I will have a try.

moooofly commented 4 years ago

by https://erlang.org/doc/man/run_erl.html , find that erlang.log is created by run_erl.