Lager: Crash.log is deleted from the folder, only rotated versions are present

21 views
Skip to first unread message

Larisa Krasnytskaya

unread,
Mar 25, 2022, 3:02:27 AM3/25/22
to erlang-q...@erlang.org

Hello!

 

After some time of app’s work, “crash.log” file appears to be deleted. Only rotated versions are present.

On one environment only one of them is present (crash.log.4), on another - more (crash.log.0, crash.log.3, crash.log.4).

 

Some inputs:

·        Scheduled rotation makes files to be deleted (by default rotation is happening on midnight);

·        Continuous application restart (as Windows service) makes files to be numbered incorrectly ;

·        Single application restart made crash.log file to be recreated;

 

Here is my lager confg:

 

  {lager, [

    {handlers, [

        {lager_file_backend, [{file, "log/error.log"}, {level, error}, {size, 10485760}, {count, 59}]},

        {lager_file_backend, [{file, "log/info.log"}, {level, info}, {size, 10485760}, {count, 29}]},

        {lager_file_backend, [{file, "log/debug.log"}, {level, debug}, {size, 31457280}, {count, 99}]}

    ] },

    {crash_log, "log/crash.log"}

  ] }

 

It looks like that the {crash_log_count} is equal to the default value, i.e. 5.

 

Lager version 3.2.4 (https://github.com/basho/lager/)

OS: Windows Server 2012

 

I would appreciate any tips on why this can happens.

 

 

Thanks in advance, Larisa

 

Luke Bakken

unread,
Mar 28, 2022, 1:15:00 PM3/28/22
to Larisa Krasnytskaya, erlang-q...@erlang.org
Hi Larisa,

I suggest that you use Lager from the current, official repository:

https://github.com/erlang-lager/lager

This PR that I submitted a while back probably fixes the issue you are
seeing - https://github.com/erlang-lager/lager/pull/509

Let me know how it goes -
Luke
Reply all
Reply to author
Forward
0 new messages