Recently I had the need to monitor the requests that were being sent to my Glassfish server. Here is the simple configuration change that needed to be done to the domain.xml file:
<configs>
<config name="server-config">
<http-service enabled="true"></http-service>
<access-log format="%client.name% %auth-user-name% %datetime% %request% %status% %response.length% %header.referer%"></access-log>
<virtual-server id="server" log="/mnt/httpd/logs/access" listeners="http-listener-1"></virtual-server>
<virtual-server id="__asadmin" listeners="admin-listener"></virtual-server>
....
</config>
</configs>
Sun’s Documentation: Enabling Access Logging