25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-12-22 17:28:25 +01:00

Small change in accesslog file format; fix bug when accesslog conf parameter wasn't present in the conf file (thanks to Jerome Sautret)

SVN Revision: 2170
This commit is contained in:
Badlop 2009-06-16 13:44:38 +00:00
parent 99fe76f8bc
commit bd106bd45f

View File

@ -56,7 +56,7 @@ process(LocalPath, Request) ->
Result = serve(LocalPath),
case ets:lookup(mod_http_fileserver, accessfile) of
undefined ->
[] ->
ok;
[{accessfile, AccessFile}] ->
{Code, _, _} = Result,
@ -114,7 +114,7 @@ log(File, Code, Request) ->
% combined apache like log format :
% 127.0.0.1 - - [28/Mar/2007:18:41:55 +0200] "GET / HTTP/1.1" 302 303 "-" "tsung"
% XXX TODO some fields are harcoded/missing (reply size, user agent or referer for example)
io:format(File, "~p - - [~p/~p/~p:~p:~p:~p] \"~s /~s~s\" ~p -1 \"-\" \"-\"~n",
io:format(File, "~s - - [~p/~p/~p:~p:~p:~p] \"~s /~s~s\" ~p -1 \"-\" \"-\"~n",
[IP, Day, Month, Year, Hour, Minute, Second, Request#request.method, Path, Query, Code]).
content_type(Filename) ->
@ -145,7 +145,7 @@ loop(Filename) ->
receive
reopenlog ->
case ets:lookup(mod_http_fileserver, accessfile) of
undefined ->
[] ->
ok;
[{accessfile, AccessFile}] ->
file:close(AccessFile),
@ -198,7 +198,7 @@ stop(_Host) ->
ok;
_ ->
case ets:lookup(mod_http_fileserver, accessfile) of
undefined ->
[] ->
ok;
[{accessfile, AccessFile}] ->
mod_http_fileserver_server ! stop,