Edi Weitz edi@agharta.de wrote:
Is it possible to record referers during logging?
Have you tried? They should be logged if *SHOW-ACCESS-LOG-MESSAGES* is on, otherwise it's a bug.
CL-USER> hunchentoot:*show-access-log-messages* T CL-USER> (hunchentoot:log-file) "/users/lnxsrv2/fe/vyazici/wiki-content/hunchentoot.log"
$ tail -n 1 "/users/lnxsrv2/fe/vyazici/wiki-content/hunchentoot.log" [2007-09-10 07:33:48] 127.0.0.1 (87.118.97.162) - "GET /page/ContentNotFound?path=documents&hunchentoot-session=149%3AC2F4FC7875F6F3FB9C9E1800D6BF7801 HTTP/1.1" 200 2058 "-" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 2.0.60767)"
Did I miss something?
By the way, I'd also be happy to see a *LOG-FORMAT* configuration parameter for a more generic logging framework.
LOG-MESSAGE is a generic function, so you can bypass it with your own methods. (I just did exactly that two days ago in a project where I had to plug Hunchentoot into an existing application which already had a logging framework.)
I couldn't make myself clear. I meant making default hunchentoot logging format (not manual logging) configured by parameter. Similar to mod_log_config of Apache. For instance,
(setq hunchentoot:*log-format* "%v %h %l %u %t "%r" %>s %b")
Regards.
On Mon, 10 Sep 2007 10:25:29 +0300, Volkan YAZICI yazicivo@ttnet.net.tr wrote:
CL-USER> hunchentoot:*show-access-log-messages* T CL-USER> (hunchentoot:log-file) "/users/lnxsrv2/fe/vyazici/wiki-content/hunchentoot.log"
$ tail -n 1 "/users/lnxsrv2/fe/vyazici/wiki-content/hunchentoot.log" [2007-09-10 07:33:48] 127.0.0.1 (87.118.97.162) - "GET /page/ContentNotFound?path=documents&hunchentoot-session=149%3AC2F4FC7875F6F3FB9C9E1800D6BF7801 HTTP/1.1" 200 2058 "-" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 2.0.60767)"
Did I miss something?
Did you check if the client actually sent a Referer header?
This is a typical log file line I see from Hunchentoot. It does contain a Referer entry (which corresponds to the "-" in your example):
127.0.0.1 - "GET /hunchentoot/test/cookie.html HTTP/1.1" 200 924 "http://localhost:4242/hunchentoot/test" "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.6) Gecko/20070725 Firefox/2.0.0.6"
I couldn't make myself clear. I meant making default hunchentoot logging format (not manual logging) configured by parameter. Similar to mod_log_config of Apache. For instance,
(setq hunchentoot:*log-format* "%v %h %l %u %t "%r" %>s %b")
Ugh, that looks like a lot of work of which I'm not sure if it should be in the "core" code. Would you consider providing this functionality as some kind of "plug-in"?
Cheers, Edi.