diff options
author | Matthias Radestock <matthias@lshift.net> | 2008-09-01 09:42:45 +0100 |
---|---|---|
committer | Matthias Radestock <matthias@lshift.net> | 2008-09-01 09:42:45 +0100 |
commit | e2049ca6f77bd7635b67f5d8f0b35e1d2922d39c (patch) | |
tree | ea1fdc4643ee9171bd663f6bc9d66e1f170ce0c4 /src/rabbit_error_logger_file_h.erl | |
parent | 93000a7040bea67e7d53ccf862b502e1fc9ac050 (diff) | |
download | rabbitmq-server-e2049ca6f77bd7635b67f5d8f0b35e1d2922d39c.tar.gz |
always log an error when append fails
and don't log the error to the console
Diffstat (limited to 'src/rabbit_error_logger_file_h.erl')
-rw-r--r-- | src/rabbit_error_logger_file_h.erl | 19 |
1 files changed, 6 insertions, 13 deletions
diff --git a/src/rabbit_error_logger_file_h.erl b/src/rabbit_error_logger_file_h.erl index 8e13a46c..e65bb576 100644 --- a/src/rabbit_error_logger_file_h.erl +++ b/src/rabbit_error_logger_file_h.erl @@ -38,19 +38,12 @@ %% Used only when swapping handlers in log rotation init({{File, Suffix}, []}) -> case rabbit_misc:append_file(File, Suffix) of - ok -> init(File); - Error -> - case init(File) of - {ok, FInfo} -> - rabbit_log:error("Error occured while appending " ++ - "~p log file to \"~s\":~n~p~n", - [File, [File, Suffix], Error]), - io:format("~nOrignal log file could not be appended to " ++ - "\"~s\"~n", [[File, Suffix]]), - {ok, FInfo}; - CriticalError -> CriticalError - end - end; + ok -> ok; + Error -> rabbit_log:error("Failed to append contents of " ++ + "log file '~s' to '~s':~n~p~n", + [File, [File, Suffix], Error]) + end, + init(File); %% Used only when swapping handlers without performing %% log rotation init({File, []}) -> |