25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-11-22 16:20:52 +01:00

* src/ejabberd_logger_h.erl: Added support for log rotation

SVN Revision: 160
This commit is contained in:
Alexey Shchepin 2003-10-27 10:13:05 +00:00
parent e595ab91a0
commit f4d2844be6
2 changed files with 12 additions and 0 deletions

View File

@ -1,3 +1,7 @@
2003-10-27 Alexey Shchepin <alexey@sevcom.net>
* src/ejabberd_logger_h.erl: Added support for log rotation
2003-10-24 Alexey Shchepin <alexey@sevcom.net>
* src/mod_offline.erl: Added function remove_old_messages/1

View File

@ -64,6 +64,14 @@ handle_call(_Request, State) ->
%%----------------------------------------------------------------------
handle_info({'EXIT', _Fd, _Reason}, _State) ->
remove_handler;
handle_info({emulator, GL, reopen}, State) ->
file:close(State#state.fd),
case file:open(State#state.file, [append]) of
{ok, Fd} ->
{ok, State#state{fd = Fd}};
Error ->
Error
end;
handle_info({emulator, GL, Chars}, State) ->
write_event(State#state.fd, {erlang:localtime(), {emulator, GL, Chars}}),
{ok, State};