[Geoserver-devel] wms and wcs service logging

Hi all,

As some may know we use an aspect to log wfs requests. The result being
a nice concise request log like the following:

21 dic 12:59:04 INFO [geoserver.wfs] -
Request: getCapabilities
  acceptVersions = null
  sections = null
  acceptFormats = null
  updateSequence = null
  baseUrl = http://localhost:8080/geoserver/
  service = wfs

It would be handy to do the same for wcs and wms. So i have made the
WFSLogger aspect a bit more generic and tested it with wcs and wms
services and it works pretty well. Some sample output:

Request: getCapabilities
  Service = WCS
  Version = 1.0.0
  Request = GetCapabilities
  BaseUrl = http://localhost:8080/geoserver/
  SchemaBaseUrl = http://localhost:8080/geoserver/schemas/
  ServiceRef = org.vfny.geoserver.wcs.servlets.Capabilities@anonymised.com
  HttpServletRequest = GET
/geoserver/wcs?request=getcapabilities&service=wCs&version=1.0.0 HTTP/1.1
Host: localhost:8080
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.6)
Gecko/20070912 Firefox/2.0.0.6
Accept:
text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Accept-Language: en,es;q=0.7,en-us;q=0.3
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 300
Connection: keep-alive
Cookie:
ACEGI_SECURITY_HASHED_REMEMBER_ME_COOKIE=YWRtaW46MTE5ODY4MjI1MjAzODozMzFmNTMzNzllMzM5NTgzOWYxMWYwNjY5YzA3NjkyZA%3D%3D;
JSESSIONID=19phayaeuhym5
Cache-Control: max-age=0

It ends up logging the HttpServletRequest which makes it a bit verbose,
but probably useful. A special case check could easily be added to avoid
logging this object. What do people think?

I have created a jira issue and attached a patch with the implementation
of the "ServiceLogger".

http://jira.codehaus.org/browse/GEOS-1641

Feedback would be much appreciated. If no issues i will go ahead and
commit to trunk... and on 1.6.x after 1.6.0 is released.

-Justin

--
Justin Deoliveira
The Open Planning Project
http://topp.openplans.org

Justin Deoliveira ha scritto:

Hi all,

As some may know we use an aspect to log wfs requests. The result being
a nice concise request log like the following:

21 dic 12:59:04 INFO [geoserver.wfs] -
Request: getCapabilities
  acceptVersions = null
  sections = null
  acceptFormats = null
  updateSequence = null
  baseUrl = http://localhost:8080/geoserver/
  service = wfs

It would be handy to do the same for wcs and wms. So i have made the
WFSLogger aspect a bit more generic and tested it with wcs and wms
services and it works pretty well. Some sample output:

Request: getCapabilities
  Service = WCS
  Version = 1.0.0
  Request = GetCapabilities
  BaseUrl = http://localhost:8080/geoserver/
  SchemaBaseUrl = http://localhost:8080/geoserver/schemas/
  ServiceRef = org.vfny.geoserver.wcs.servlets.Capabilities@anonymised.com
  HttpServletRequest = GET
/geoserver/wcs?request=getcapabilities&service=wCs&version=1.0.0 HTTP/1.1
Host: localhost:8080
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.6)
Gecko/20070912 Firefox/2.0.0.6
Accept:
text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Accept-Language: en,es;q=0.7,en-us;q=0.3
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 300
Connection: keep-alive
Cookie:
ACEGI_SECURITY_HASHED_REMEMBER_ME_COOKIE=YWRtaW46MTE5ODY4MjI1MjAzODozMzFmNTMzNzllMzM5NTgzOWYxMWYwNjY5YzA3NjkyZA%3D%3D;
JSESSIONID=19phayaeuhym5
Cache-Control: max-age=0

It ends up logging the HttpServletRequest which makes it a bit verbose,
but probably useful. A special case check could easily be added to avoid
logging this object. What do people think?

It seems very similar to the generic request logger filter
dwinslow is working on?

Cheers
Andrea

It seems very similar to the generic request logger filter
dwinslow is working on?

Well then... we should probably coordinate then. Dwinslow, have you
comitted any code. If we do decide to go with a servlet filter then what
is the plan for current wfs logging? Getting rid of the aspect?

One issue I do forsee with using a servlet filter is that it cannot log
hte request object. Perhaps a combination of a servlet filter that logs
the "raw" request, and a logging aspect that only logs the request
object might work well.

Cheers
Andrea

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Geoserver-devel mailing list
Geoserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel

!DSPAM:4007,476cdbb3230761012714783!

--
Justin Deoliveira
The Open Planning Project
http://topp.openplans.org

I went ahead and committed the logging module I've been working on to
trunk (revision 8071). There are a couple of configuration options for
it, I think they're pretty clearly documented in the web.xml file.

The reason I'm doing it as a filter is that we want to log the request
before any processing is done on it. The geoserver on artois occasionally
receives a request that locks it up, so we want to make sure the offending
request is logged even if we have to kill the process.

-David

On Sat, December 22, 2007 1:02 pm, Justin Deoliveira wrote:

It seems very similar to the generic request logger filter
dwinslow is working on?

Well then... we should probably coordinate then. Dwinslow, have you
comitted any code. If we do decide to go with a servlet filter then what is
the plan for current wfs logging? Getting rid of the aspect?

One issue I do forsee with using a servlet filter is that it cannot log
hte request object. Perhaps a combination of a servlet filter that logs the
"raw" request, and a logging aspect that only logs the request
object might work well.

Cheers
Andrea

-----------------------------------------------------------------------
--
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Geoserver-devel mailing list
Geoserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel

--
Justin Deoliveira
The Open Planning Project
http://topp.openplans.org

!DSPAM:4040,476d515211394901796417!

Ok cool, so I think the two are pretty much orthogonal.. the servlet
filter for the raw request, and the aspect for logging the actual
service call, executed after the dispatcher has done its thing.

dwinslow@anonymised.com wrote:

I went ahead and committed the logging module I've been working on to
trunk (revision 8071). There are a couple of configuration options for
it, I think they're pretty clearly documented in the web.xml file.

The reason I'm doing it as a filter is that we want to log the request
before any processing is done on it. The geoserver on artois occasionally
receives a request that locks it up, so we want to make sure the offending
request is logged even if we have to kill the process.

-David

On Sat, December 22, 2007 1:02 pm, Justin Deoliveira wrote:

It seems very similar to the generic request logger filter
dwinslow is working on?

Well then... we should probably coordinate then. Dwinslow, have you
comitted any code. If we do decide to go with a servlet filter then what is
the plan for current wfs logging? Getting rid of the aspect?

One issue I do forsee with using a servlet filter is that it cannot log
hte request object. Perhaps a combination of a servlet filter that logs the
"raw" request, and a logging aspect that only logs the request
object might work well.

Cheers
Andrea

-----------------------------------------------------------------------
--
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Geoserver-devel mailing list
Geoserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel

--
Justin Deoliveira
The Open Planning Project
http://topp.openplans.org

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Geoserver-devel mailing list
Geoserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel

!DSPAM:4007,476eabb2311733668746562!

--
Justin Deoliveira
The Open Planning Project
http://topp.openplans.org