How do I log all process crashes into a file instead of a tty ? I've read in the documentation that there are some standard Erlang modules that can do it (SASL, error_logger), but unfortunately haven't found any clean examples.
The error log file contains errors the server has encountered since the log file was created; it also contains informational messages about the server, such as when the server was started. Unsuccessful user authentication is also recorded in the error log.
Approach 1: The error_log() function can be used to send error messages to a given file. First argument to the function is the error message to be sent. Second argument tells where to send/log the error message. In this case, second argument is set to 3, used to redirect error message to a file.
Start your erl node with
erl -boot start_sasl -sasl sasl_error_logger \{file,\"path/to/logfile.log\"\}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With