Skip to content

Instantly share code, notes, and snippets.

@mdaguete
Created March 1, 2012 12:34
Show Gist options
  • Save mdaguete/1949553 to your computer and use it in GitHub Desktop.
Save mdaguete/1949553 to your computer and use it in GitHub Desktop.
Clear Erlang SASL error logger.
-module(my_system_utilities).
-export([clear_sasl_error_log/0]).
clear_sasl_error_log() ->
case application:get_env(sasl,sasl_error_logger) of
{ok, {file, SASLfile}} ->
error_logger:delete_report_handler(sasl_report_file_h),
error_logger:add_report_handler(sasl_report_file_h,
{SASLfile,logger_type()});
_ ->
not_rotated
end.
logger_type() ->
case application:get_env (sasl, errlog_type) of
{ok, error} -> error;
{ok, progress} -> progress;
{ok, all} -> all;
{ok, Bad} -> exit ({bad_config, {sasl, {errlog_type, Bad}}});
_ -> all
end.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment