[Yanel-dev] Access Log Format

Cedric Staub cedric.staub at wyona.com
Wed Feb 9 16:47:25 CET 2011


Hello there!

Remember when we changed the format of the access logfile Yanel
generates? Back then, I created a function which generates the string
for the access log, so that other functions can call it instead of
having to build the string themselves.

Well, as it turns out, I forgot to change it in one place! That means
Yanel now generates mixed old/new formatted access logs depending on the
situation, which is not very nice. You won't notice it until you try to
automatically parse the logfile, at which point you will see that some
access log lines differ from the others.

I attached a patch to fix the problem! It changes only a single line.

About the patch:
- Does it build?  Yes
- Is the formatting correct?  Yes
- Is it backwards compatible? No, but that's the point.
- Does it scale/perform? N/A
- Can it be enhanced? Yes
- Can it be customized? No
- Does it work within a cluster? Yes
- Is it secure? Well, I guess so.
- Can it be used offline? Yes
- Can the patch be reverted easily? Yes
- Does an automatic test exist? No
- Does it work for all browsers? N/A

Cheers
Cedric
-------------- next part --------------
Index: src/webapp/src/java/org/wyona/yanel/servlet/YanelServlet.java
===================================================================
--- src/webapp/src/java/org/wyona/yanel/servlet/YanelServlet.java	(working copy)
+++ src/webapp/src/java/org/wyona/yanel/servlet/YanelServlet.java	(working copy)
@@ -2472,3 +2472,3 @@
                 String requestURL = request.getRequestURL().toString();
-                logAccess.info(requestURL + " r:" + realm.getID() + " c:" + cookie.getValue() + " u:" + identity.getUsername() + " ref:" + request.getHeader("referer") + " ua:" + request.getHeader("User-Agent")); // INFO: See a list of user agents at http://www.user-agents.org/
+                logAccess.info(AccessLog.getLogMessage(request, response, realm.getID());
             } else {


More information about the Yanel-development mailing list