diff options
author | Hubert Plociniczak <hubert@lshift.net> | 2008-08-29 15:57:25 +0100 |
---|---|---|
committer | Hubert Plociniczak <hubert@lshift.net> | 2008-08-29 15:57:25 +0100 |
commit | eca2d86ac28a34bd434ea6327c1bfc97aeb24e3e (patch) | |
tree | 68ca6279b79df577a64d1f38d0b4984e360209b1 /src/rabbit_error_logger_file_h.erl | |
parent | c183714de261b9ea977a191ace5adad3f8fd7f89 (diff) | |
download | rabbitmq-server-git-eca2d86ac28a34bd434ea6327c1bfc97aeb24e3e.tar.gz |
When appending the old log file fails always try
to create the handler. This can happen when the
file we append to is not writable.
Fixed missing case clause.
Diffstat (limited to 'src/rabbit_error_logger_file_h.erl')
-rw-r--r-- | src/rabbit_error_logger_file_h.erl | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/src/rabbit_error_logger_file_h.erl b/src/rabbit_error_logger_file_h.erl index d5c0ab0891..2de861b626 100644 --- a/src/rabbit_error_logger_file_h.erl +++ b/src/rabbit_error_logger_file_h.erl @@ -38,13 +38,23 @@ %% Used only when swapping handlers in log rotation init({{File, Suffix}, []}) -> case rabbit_misc:append_file(File, Suffix) of - ok -> error_logger_file_h:init(File); - Error -> Error + ok -> init(File); + Error -> + case init(File) of + {ok, FInfo} -> + error_logger:error_msg("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; %% Used only when swapping handlers without performing %% log rotation init({File, []}) -> - error_logger_file_h:init(File); + init(File); init({_File, _Type} = FileInfo) -> error_logger_file_h:init(FileInfo); init(File) -> |