I just realized that I didn't explain the 2nd patch. This patch uses the second parameter in the log (normally just '-') and gives the hostname that was requested. This has been very helpful when you have different domains going to the same virtual host. It just utilizes the 'host' variable from the connection. Testing it, it will give the hostname (http://somehost.com/) or the IP (http://1.2.3.4/) depending on what the client requested.
Sorry about that! Sincerely, Jaime Bozza -----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of Jaime Bozza Sent: Tuesday, March 31, 2009 12:19 PM To: [email protected] Subject: [Cherokee] Logger Format As I'm doing my testing, I noticed that the Apache Log format isn't quite right. The logger doesn't log the query string of a request, just the request itself. Apache logs the query string (%r = method, path, query-string, protocol), where Cherokee skips the query-string portion. I've attached a patch that should fix this. The 2nd patch (logger_host_patch) is something brought over from Lighttpd. This may or may not be appropriate for logger_ncsa, but it could be something that might work for logger_custom. If logger_custom is to be used, it would be nice to be able to duplicate the same thing with query-string as above. The current custom logger doesn't have a way to add the '?' between the request and the query-string only when query_string isn't blank. It (custom logger) is also missing a few other things (timestamp, bytes sent, etc) that makes it seem this isn't complete just yet. The 3rd issue I'm having with the logfiles is that timezone is showing up at +0000 instead of my timezone of -0500 (CDT). I'm on FreeBSD, so this may be the issue. I don't have a patch for this at this point. In messing with the timezone stuff, I also found out that timezones to the west of GMT (such as -0500) will be displayed in the log as '--500'. I think a simple abs() will fix this issue, but the lack of timezone for people that don't have the timezone variable is a bit problematic. Since I have tm_gmtoff, I was able to use localtime_r() to acquire the timezone from the tm struct, but I don't think my code is ready for an actual patch since it assumes that tm_gmtoff and localtime_r are both available. I do see that you test for all these things, so I can get a patch to you if you'd like. Sincerely, Jaime Bozza _______________________________________________ Cherokee mailing list [email protected] http://lists.octality.com/listinfo/cherokee
