tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tim Funk <funk...@joedog.org>
Subject [5] Extended AccessLog Valve
Date Sun, 01 Jun 2003 00:22:22 GMT
For one of my projects, I am working on an extended access log valve as
defined by http://www.w3.org/TR/WD-logfile.html. When (if) I finish this,
does anyone else have interst in this?

It will have the following config options:
directory - Where to put the logs (like AccessLogValve)
pattern   - The log pattern
prefix    - File Name prefix (like AccessLogValve)
rotatable - Is this a rotating log (like AccessLogValve)
suffix    - Ending text (like AccessLogValve)
condition  - Conditionally log requests. This is a String value. If set,
             then the value in condition will be the key in a lookup
             for a ServletRequest attribute. If the result is non-null
             then the logging is skipped for this entry. This can be an
             easy foundation to allow users to omit monitoring software
             from the access logs.
checkExists - If set, if will check for the log files existence on the
               event an external tool moved it. If the file doesn't exist
               the close takes place and attempt to reopen the log file
               occurs.

For app-specific logging, I made this (so far):
x-A(...) - Pull ... from the servletConext.getAttribute()
x-C(...) - Pull cookie named ...
x-R(...) - Pull ... from the servletRequest.getAttribute()
x-S(...) - Pull ... from the session.getAttribute()
x-H(...) - Call the appriopriate get or is method in the
            HttpServletRequest for any of the following based on ...
    authType
    characterEncoding
    contentLength
    locale
    protocol
    remoteUser
    requestedSessionId
    requestedSessionIdFromCookie
    requestedSessionIdValid
    scheme
    secure	


I also expose a JMX operation called rotate. This will allow an external 
"thing" be able move the log file to a new name, then reopen the old filename.
	
With any luck, the code is attached (2 attachments). It builds (and seems to 
run) fine off of tomcat 5. Comments? Would this be OK of I added this to 5? 
If so, are there changes (style/...) which need made first?




-Tim



Mime
View raw message