dev@glassfish.java.net

Re: [V3] how to turn on access log ?

From: <Jan.Luehe_at_Sun.COM>
Date: Tue, 08 Apr 2008 09:51:41 -0700

Anissa,


Jan.Luehe_at_Sun.COM wrote:

> Hi Anissa,
>
> Anissa Lam wrote:
>
>>
>> I tried to turn on access logging to __asadmin, here is how
>> domain.xml looks like:
>>
>> <virtual-server default-web-module="" state="on"
>> hosts="${com.sun.aas.hostName}"
>> log-file="${com.sun.aas.instanceRoot}/logs/server.log" id="__asadmin"
>> http-listeners="admin-listener">
>> <property value="${com.sun.aas.instanceRoot}/docroot"
>> name="docroot" />
>> <property value="${com.sun.aas.instanceRoot}/logs/access"
>> name="accesslog" />
>> <property value="false" name="sso-enabled" />
>> <property value="true" name="accessLoggingEnabled" />
>> </virtual-server>
>>
>> After i restart the server, i can see the file
>> __asadmin_access_log.2008-04-06.txt created under
>> domains/domain1/logs/access
>> however, the file size is always zero, and nothing is recorded in
>> the file.
>>
>> Is access logging supported in TP2 ? Is this a known issue ? Or do
>> i need to do something extra to trigger the logging ?
>
>
>
> I don't think this is a known issue, but I was able to reproduce it.
>
> The above configuration should be sufficient to enable access logging.
>
> I'm looking into this. Can you please file a bug?



I think I understand what's going on.

- Access logging is a virtual server feature (enabled as a virtual
  server valve), meaning unless a virtual server has been started,
  access logging won't be enabled. Virtual servers are started when the
  web container is initialized, which happens when the first WAR is
  deployed. Therefore, if you access any of the http listeners with a
  URI equal to "/" before you have deployed any WAR file, these requests
  will not be access-logged.

- I noticed that even after the first WAR deployment, any requests
  with a URI equal to "/" are still not getting access-logged, while
  those for a context root different from "/" do. This is because when a
  virtual server is started, the code currently does not register any
  dummy webmodule off the virtual server's docroot (Amy is working on a
  fix for this), meaning a request for "/" is handled by the adapter
  (VsAdapter) locally instead of being dispatched to the web container
  and its request processing pipeline (including the virtual server's
  access logging valve). Once we register a virtual server's dummy
  webmodule as an endpoint for "/" when the virtual server is started,
  requests for "/" will get access-logged.


Jan


>
> Thanks,
>
>
> Jan
>
>>
>> thanks
>> Anissa
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe_at_glassfish.dev.java.net
>> For additional commands, e-mail: dev-help_at_glassfish.dev.java.net
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: dev-help_at_glassfish.dev.java.net
>