[Geoserver-devel] Logging requests in WPS

Hi,
today I've tried to hook up the EMF Logger that WFS uses to WPS,
getting results like:

Request: execute
  language = null
  service = WPS
  version = 1.0.0
  baseUrl = http://localhost:8080/geoserver/
  extendedProperties = {}
  identifier:
    value = JTS:area
    codeSpace = null
  dataInputs:
    input = [net.opengis.wps10.impl.InputTypeImpl@anonymised.com]
  responseForm:
    responseDocument = null
    rawDataOutput:
      identifier = net.opengis.ows11.impl.CodeTypeImpl@anonymised.com (value:
result, codeSpace: null)
      encoding = null
      mimeType = null
      schema = null
      uom = null

Meh, not very useful. For some reason InputTypeImpl has been generated
in such a way that it does not contain a toString().
Skipping the idea of regenerating the bindings (don't know how much Eclipse EMF
has changed since those classes were generated) I've tried out the attached
patch to the EMF logger, which instead expands collections, that results in:

Request: execute
  language = null
  service = WPS
  version = 1.0.0
  baseUrl = http://localhost:8080/geoserver/
  extendedProperties = {}
  identifier:
    value = JTS:area
    codeSpace = null
  dataInputs:
    input[0]:
      identifier = net.opengis.ows11.impl.CodeTypeImpl@anonymised.com (value:
geom, codeSpace: null)
      title = null
      abstract = null
      reference = net.opengis.wps10.impl.InputReferenceTypeImpl@anonymised.com
(body: net.opengis.wps10.impl.ExecuteTypeImpl@anonymised.com (language:
null, service: WPS, version: 1.0.0, baseUrl: null, extendedProperties:
{}), encoding: null, href: http://geoserver/wps, method: POST,
mimeType: text/xml; subtype=gml/3.1.1, schema: null)
      data = null
  responseForm:
    responseDocument = null
    rawDataOutput:
      identifier = net.opengis.ows11.impl.CodeTypeImpl@anonymised.com (value:
result, codeSpace: null)
      encoding = null
      mimeType = null
      schema = null
      uom = null

Ah, much better. There is a side effect though, it makes the WFS logs
more verbose, even if a bit
more readable (the query property used to be expressed in a single line):

Request: getFeature
  handle = null
  service = WFS
  version = 1.0.0
  baseUrl = http://localhost:8080/geoserver/
  providedVersion = null
  extendedProperties = {}
  query[0]:
    group =
    propertyName =
    xlinkPropertyName =
    function =
    filter = null
    sortBy =
    featureVersion = null
    handle = null
    srsName = null
    typeName[0] = {http://www.openplans.org/topp\}pgstates2
  maxFeatures = 50
  outputFormat = GML2
  resultType = results
  traverseXlinkDepth = null
  traverseXlinkExpiry = null
  formatOptions = {}
  metadata = null
  startIndex = null

Hmm... opinions?

Cheers
Andrea

--
-------------------------------------------------------
Ing. Andrea Aime
GeoSolutions S.A.S.
Tech lead

Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy

phone: +39 0584 962313
fax: +39 0584 962313
mob: +39 339 8844549

http://www.geo-solutions.it
http://geo-solutions.blogspot.com/
http://www.youtube.com/user/GeoSolutionsIT
http://www.linkedin.com/in/andreaaime
http://twitter.com/geowolf

-------------------------------------------------------

(attachments)

emfLogger.patch (3.09 KB)

No problem with the patch here. However adding toString() to InputTypeImpl won’t require any regeneration or anything. Just add the toString() method as you normally would. To save it during future regenerations just add the following in the javadoc of it.

/**

  • @generated NOT
    */
    public String toString() {

    }

On Fri, Mar 23, 2012 at 8:57 AM, Andrea Aime <andrea.aime@anonymised.com8…> wrote:

Hi,
today I’ve tried to hook up the EMF Logger that WFS uses to WPS,
getting results like:

Request: execute
language = null
service = WPS
version = 1.0.0
baseUrl = http://localhost:8080/geoserver/
extendedProperties = {}
identifier:
value = JTS:area
codeSpace = null
dataInputs:
input = [net.opengis.wps10.impl.InputTypeImpl@anonymised.com]
responseForm:
responseDocument = null
rawDataOutput:
identifier = net.opengis.ows11.impl.CodeTypeImpl@anonymised.com (value:
result, codeSpace: null)
encoding = null
mimeType = null
schema = null
uom = null

Meh, not very useful. For some reason InputTypeImpl has been generated
in such a way that it does not contain a toString().
Skipping the idea of regenerating the bindings (don’t know how much Eclipse EMF
has changed since those classes were generated) I’ve tried out the attached
patch to the EMF logger, which instead expands collections, that results in:

Request: execute
language = null
service = WPS
version = 1.0.0
baseUrl = http://localhost:8080/geoserver/
extendedProperties = {}
identifier:
value = JTS:area
codeSpace = null
dataInputs:
input[0]:
identifier = net.opengis.ows11.impl.CodeTypeImpl@anonymised.com (value:
geom, codeSpace: null)
title = null
abstract = null
reference = net.opengis.wps10.impl.InputReferenceTypeImpl@anonymised.com
(body: net.opengis.wps10.impl.ExecuteTypeImpl@anonymised.com (language:
null, service: WPS, version: 1.0.0, baseUrl: null, extendedProperties:
{}), encoding: null, href: http://geoserver/wps, method: POST,
mimeType: text/xml; subtype=gml/3.1.1, schema: null)
data = null
responseForm:
responseDocument = null
rawDataOutput:
identifier = net.opengis.ows11.impl.CodeTypeImpl@anonymised.com (value:
result, codeSpace: null)
encoding = null
mimeType = null
schema = null
uom = null

Ah, much better. There is a side effect though, it makes the WFS logs
more verbose, even if a bit
more readable (the query property used to be expressed in a single line):

Request: getFeature
handle = null
service = WFS
version = 1.0.0
baseUrl = http://localhost:8080/geoserver/
providedVersion = null
extendedProperties = {}
query[0]:
group =
propertyName =
xlinkPropertyName =
function =
filter = null
sortBy =
featureVersion = null
handle = null
srsName = null
typeName[0] = {http://www.openplans.org/topp}pgstates2
maxFeatures = 50
outputFormat = GML2
resultType = results
traverseXlinkDepth = null
traverseXlinkExpiry = null
formatOptions = {}
metadata = null
startIndex = null

Hmm… opinions?

Cheers
Andrea

Ing. Andrea Aime
GeoSolutions S.A.S.
Tech lead

Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy

phone: +39 0584 962313
fax: +39 0584 962313
mob: +39 339 8844549

http://www.geo-solutions.it
http://geo-solutions.blogspot.com/
http://www.youtube.com/user/GeoSolutionsIT
http://www.linkedin.com/in/andreaaime
http://twitter.com/geowolf



This SF email is sponsosred by:
Try Windows Azure free for 90 days Click Here
http://p.sf.net/sfu/sfd2d-msazure


Geoserver-devel mailing list
Geoserver-devel@anonymised.comsts.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel


Justin Deoliveira
OpenGeo - http://opengeo.org
Enterprise support for open source geospatial.

On Fri, Mar 23, 2012 at 4:14 PM, Justin Deoliveira <jdeolive@anonymised.com> wrote:

No problem with the patch here.

Cooked up a variation that generates more compact output, avoiding
logs for empty
collections and null values.

Request: getFeature
    service = WFS
    version = 1.0.0
    baseUrl = http://localhost:8080/geoserver/
    query[0]:
        typeName[0] = {http://www.openplans.org/topp\}pgstates2
    maxFeatures = 50
    outputFormat = GML2
    resultType = results

Request: execute
    service = WPS
    version = 1.0.0
    baseUrl = http://localhost:8080/geoserver/
    identifier:
        value = JTS:area
    dataInputs:
        input[0]:
            identifier = net.opengis.ows11.impl.CodeTypeImpl@anonymised.com
(value: geom, codeSpace: null)
            reference =
net.opengis.wps10.impl.InputReferenceTypeImpl@anonymised.com (body:
net.opengis.wps10.impl.ExecuteTypeImpl@anonymised.com (language: null,
service: WPS, version: 1.0.0, baseUrl: null, extendedProperties: {}),
encoding: null, href: http://geoserver/wps, method: POST, mimeType:
text/xml; subtype=gml/3.1.1, schema: null)
    responseForm:
        rawDataOutput:
            identifier = net.opengis.ows11.impl.CodeTypeImpl@anonymised.com
(value: result, codeSpace: null)

Imho looks also better than what we have in svn today.

Cheers
Andrea

--
-------------------------------------------------------
Ing. Andrea Aime
GeoSolutions S.A.S.
Tech lead

Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy

phone: +39 0584 962313
fax: +39 0584 962313
mob: +39 339 8844549

http://www.geo-solutions.it
http://geo-solutions.blogspot.com/
http://www.youtube.com/user/GeoSolutionsIT
http://www.linkedin.com/in/andreaaime
http://twitter.com/geowolf

-------------------------------------------------------

(attachments)

emfLogger.patch (3.54 KB)