Setting up crash.log rotation

I use (recent version) rebar3 releases with Erlang v25 and lager. The thing is I am able to configure lager logging including options like file rotation, number of rotated files and their size. However there’s crash.log file, which rotates as well but only 6 of them stays in place. I really like crash.log files and would like to have more of them saved on a disk.
How to configure number of rotated crash.log files? Where exactly in rebar3 release file/directory structure?

I’ve just found out new logging released in OTP v21 but didn’t see anything regarding crash.log files. Tried it and error files from new logger are different - looks like normal log files with not that much details as can be found in crash.log. I can switch from lager to new OTP logger, but I need crash.log and more of them :slight_smile:

Thank You

For lager, you can set crash_log_count application env variable to number of crash logs you want. Default is 5 and that’s why you only get 6 of them in total. “crash.log” files are specific to lager, that is why there is nothing about them in logger. You can implement a handler for logger to get something like “crash.log” if you want to switch to it.

1 Like