aboutsummaryrefslogtreecommitdiffstats
path: root/lib/sasl/src/sasl.erl
diff options
context:
space:
mode:
authorSerge Aleynikov <[email protected]>2014-04-20 12:37:57 -0400
committerBjörn Gustavsson <[email protected]>2015-05-28 13:34:45 +0200
commit885ad5783c33d7f6115c5ad55c401102f10039d6 (patch)
treeb74e9cbc55f22cb5f797ff37be50c964ca354a41 /lib/sasl/src/sasl.erl
parentce96ab6d64768cd6536011ccdecc08191c238220 (diff)
downloadotp-885ad5783c33d7f6115c5ad55c401102f10039d6.tar.gz
otp-885ad5783c33d7f6115c5ad55c401102f10039d6.tar.bz2
otp-885ad5783c33d7f6115c5ad55c401102f10039d6.zip
Customize SASL error_logger file opening modes
Include the ability to open a SASL error log file in append mode at startup vs currently implemented "rewrite-always" mode.
Diffstat (limited to 'lib/sasl/src/sasl.erl')
-rw-r--r--lib/sasl/src/sasl.erl8
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/sasl/src/sasl.erl b/lib/sasl/src/sasl.erl
index fdea6da13e..4a220f0511 100644
--- a/lib/sasl/src/sasl.erl
+++ b/lib/sasl/src/sasl.erl
@@ -55,7 +55,9 @@ get_sasl_error_logger() ->
case application:get_env(sasl, sasl_error_logger) of
{ok, false} -> undefined;
{ok, tty} -> tty;
- {ok, {file, File}} when is_list(File) -> {file, File};
+ {ok, {file, File}} when is_list(File) -> {file, File, [write]};
+ {ok, {file, File, Modes}} when is_list(File), is_list(Modes) ->
+ {file, File, Modes};
{ok, Bad} -> exit({bad_config, {sasl, {sasl_error_logger, Bad}}});
_ -> undefined
end.
@@ -125,9 +127,9 @@ delete_sasl_error_logger(Type) ->
error_logger:delete_report_handler(mod(Type)).
mod(tty) -> sasl_report_tty_h;
-mod({file, _File}) -> sasl_report_file_h.
+mod({file, _File, _Modes}) -> sasl_report_file_h.
-args({file, File}, Type) -> {File, type(Type)};
+args({file, File, Modes}, Type) -> {File, Modes, type(Type)};
args(_, Type) -> type(Type).
type(error) -> error;