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 | d5f55cc7c73e2962c9334b18bccca5759e464d64 (patch) | |
| tree | ea1fdc4643ee9171bd663f6bc9d66e1f170ce0c4 /src | |
| parent | a897c30e00b9fa614f4675590983f06a3332809b (diff) | |
| download | rabbitmq-server-git-d5f55cc7c73e2962c9334b18bccca5759e464d64.tar.gz | |
always log an error when append fails
and don't log the error to the console
Diffstat (limited to 'src')
| -rw-r--r-- | src/rabbit_error_logger_file_h.erl | 19 | ||||
| -rw-r--r-- | src/rabbit_sasl_report_file_h.erl | 19 |
2 files changed, 12 insertions, 26 deletions
diff --git a/src/rabbit_error_logger_file_h.erl b/src/rabbit_error_logger_file_h.erl index 8e13a46c37..e65bb57626 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, []}) -> diff --git a/src/rabbit_sasl_report_file_h.erl b/src/rabbit_sasl_report_file_h.erl index cc46307412..befd80577b 100644 --- a/src/rabbit_sasl_report_file_h.erl +++ b/src/rabbit_sasl_report_file_h.erl @@ -39,19 +39,12 @@ %% 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 sasl log file to \"~s\":~n~p~n", - [File, [File, Suffix], Error]), - io:format("~nOrignal sasl 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 " ++ + "sasl log file '~s' to '~s':~n~p~n", + [File, [File, Suffix], Error]) + end, + init(File); %% Used only when swapping handlers without %% doing any log rotation init({File, []}) -> |
