logo       

Re: CustomRequestLog.java: msg#00035

java.jetty.general

Subject: Re: CustomRequestLog.java


Chris,

Firstly: COOL!
Secondly: comments in-line.

Chris Forkin wrote:

Done sofar:
%...a: use request.getRemoteAddr()
%...A: use InetAddress.getByName(request.getHost()) (inefficient??)
%...B: use responseLength
%...b: use responseLength
%...c: don't know (maybe response.getState() in conjunction with
response.getField(HttpFields.__KeepAlive) ??)

MMmm you will have to add some access methods to get this - please add
them and then you can send the patches.

Firstly you need to access response.getHttpConnection()._persistent to see if the connection is persistent or will be closed.

I don't think we can generate X at the moment, as I don't log failed
requests in the request log (only in the jetty log). If you think
X is really needed I can look at making a change, where it would pass
in a null response if handling failed.

%...{Foobar}e: use System.getProperty("Foobar") or ignore

well that is not really an environment variable - but I guess it is
the equivalent for java.

%...f: don't know


response.getHttpContext().getResource(request.getPath().substring(response.getHttpContext().getContextPath().length()));
may need some null pointer protection in all that.
may also be a better way...
%...h: use request.getRemoteHost()
%...H: use request.getScheme()
%...{Foobar}i: use request.getField("Foobar")
%...l: don't know

request.getUserPrincipal().toString()

%...m: use request.getMethod()
%...{Foobar}n: ignored (do Handlers communicate anything usefull??)
%...{Foobar}o: use response.getField("Foobar")
%...p: use request.getPort()
%...P: don't know is there a System.getProperty("java.process.id")?

Thread.currentThread().getName()

%...q: use request.getQuery()
%...r: don't know

request.getRequestLine()

%...s: don't know use response.getStatus()??

Not sure what this means???

%...t: use request.getTimeStamp() and java.util.Calendar et.al.
%...T: don't know maybe request.getTimeStamp() with System.currentTimeMillis()?
%...u: use request.getAuthUser() (or request.getUserPrincipal().getName()??)
%...U: use request.getRequestURL()
%...v: use request.getHost() ??
%...V: use request.getHost() ??

maybe the local address from InetAddress?


If anybody could assist and let me know if any of my assumptions are wrong
or knows how to get at the missing information, I'd be gratefull :-)
Once this is finished and tested, would anybody else be interested in it?
If yes, I could donate it to Jetty if someone would explain the procedure.

You write the code
you post the code
we use the code.

Main choice is if you want to retain copyright yourself (in that case use your
own package name) or assign copyright to Mort Bay (and use org.mortbay.http
package)


cheers




-------------------------------------------------------
This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170
Project Admins to receive an Apple iPod Mini FREE for your judgement on
who ports your project to Linux PPC the best. Sponsored by IBM.
Deadline: Sept. 24. Go here: http://sf.net/ppc_contest.php


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise