users@glassfish.java.net

Re: Glassfish Access Log Format

From: Jan Luehe <Jan.Luehe_at_Sun.COM>
Date: Tue, 10 Nov 2009 09:21:03 -0800

Hi Imran,

On 11/10/09 08:27, glassfish_at_javadesktop.org wrote:
> Hello folks
>
> I've got a requirement to have the GF access logs written in the same format as my apache access logs. I started playing around with the log format on the http service, but have hit a road-block in getting a like-for-like log format to apache. My apache access log format is customised for our requirement so it's not using combined/common formats. So the GF common/combined format doesn't help me.
> All I need is to get the exact formatting done. I could get all data I need. However, the double quotes surrounding most of the data is problematic to me. I've come across the following discussion and for a moment thought that stripping out the double quotes were going to be easy.
> https://glassfish.dev.java.net/issues/show_bug.cgi?id=518
>
> But it appears that's not as straightforward and peaking into DefaultAccessLogFormatterImpl.java shows it adding the double quote before and after the data element. Is there a particular reason for this? And can we have this changed to a perhaps a configurable character instead of double quotes. This is probably not an issue for most people, but when we have external tools reading access logs and when you shift from modjk loadbalancing and loose the apache access logs for GF requests it poses a problem if the external tool expects a specific format.
>
> Given the double quote is a static final class attribute, I doubt it that I can have some thing quick and easy to get over this, but will this be considered to be configurable in any future releases or can I be pointed to any other workaround to get rid of the double quotes and include any character surrounding my data? Thanks!!
>

We'll definitely consider this.

Can you please submit an ENHANCEMENT request at
  https://glassfish.dev.java.net/servlets/ProjectIssues?

The original purpose of the quotes was to delimit any access log values
that have spaces.
We should probably only use quotes if a particular access log value
indeed contains spaces,
and not use spaces otherwise.

Would that address your requirement?

Otherwise, we could add an attribute of type boolean to <access-log>
that would let you
disable quotes.

Thanks,


Jan
> Cheers
> -- Imran
> [Message sent by forum member 'imranbohoran' (imranbohoran_at_gmail.com)]
>
> http://forums.java.net/jive/thread.jspa?messageID=371289
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>
>