Can I skip logging MS_NOTFOUND errors?

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Can I skip logging MS_NOTFOUND errors?

Peter Schmitt
Hi,

I have MapServer configured to serve a WFS endpoint with GeoJSON. The data itself is in a PostGIS database.  When I make a query for data that's non-existent, I get an empty feature collection:

>  curl http://localhost/mapserv?service=WFS&VERSION=1.1.0&REQUEST=getfeature&typename=some_layer&srsname=EPSG:4326&OUTPUTFORMAT=geojson&some_runtime_substitution_parameter=42
>  {
>    "type": "FeatureCollection",
>    "name": "some_layer",
>    "features": []
>  }

This works as anticipated.  What I didn't expect is that MapServer logs an error:

> msQueryByRect(): Search returned no results. No matching record(s) found

I think this code is being invoked: https://github.com/mapserver/mapserver/blob/master/mapquery.c#L1287-L1288

I do not think having no results should be considered an error.  Is there a way to silence just this one  type of error?  I couldn't find anything obvious other than other than redirecting stderr to /dev/null or remove it via grep/sed.

Thanks,
Pete

_______________________________________________
mapserver-users mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/mapserver-users
Reply | Threaded
Open this post in threaded view
|

Re: Can I skip logging MS_NOTFOUND errors?

lars.schylberg
Does it make a difference if You define:

CONFIG 'ON_MISSING_DATA' 'IGNORE'

on the map level?

/Lars S.

4 juni 2019 kl. 21:44, "Peter Schmitt" <[hidden email]> skrev:
Hi,

I have MapServer configured to serve a WFS endpoint with GeoJSON. The data itself is in a PostGIS database. When I make a query for data that's non-existent, I get an empty feature collection:

> curl http://localhost/mapserv?service=WFS&VERSION=1.1.0&REQUEST=getfeature&typename=some_layer&srsname=EPSG:4326&OUTPUTFORMAT=geojson&some_runtime_substitution_parameter=42
> {
> "type": "FeatureCollection",
> "name": "some_layer",
> "features": []
> }

This works as anticipated. What I didn't expect is that MapServer logs an error:
> msQueryByRect(): Search returned no results. No matching record(s) found

I think this code is being invoked: https://github.com/mapserver/mapserver/blob/master/mapquery.c#L1287-L1288

I do not think having no results should be considered an error. Is there a way to silence just this one type of error? I couldn't find anything obvious other than other than redirecting stderr to /dev/null or remove it via grep/sed.
Thanks,
Pete



_______________________________________________
mapserver-users mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/mapserver-users
Reply | Threaded
Open this post in threaded view
|

Re: Can I skip logging MS_NOTFOUND errors?

Peter Schmitt
Hi Lars,

Thanks for the suggestion, but it didn't work. I see there's an open pull request to log MS_NOTFOUND based on DEBUG log level:
I'll follow along there to see if there are any ideas to unblock its status.

Cheers,
Pete

On Wed, Jun 5, 2019 at 2:27 AM <[hidden email]> wrote:
Does it make a difference if You define:

CONFIG 'ON_MISSING_DATA' 'IGNORE'

on the map level?

/Lars S.

4 juni 2019 kl. 21:44, "Peter Schmitt" <[hidden email]> skrev:
Hi,

I have MapServer configured to serve a WFS endpoint with GeoJSON. The data itself is in a PostGIS database. When I make a query for data that's non-existent, I get an empty feature collection:

> curl http://localhost/mapserv?service=WFS&VERSION=1.1.0&REQUEST=getfeature&typename=some_layer&srsname=EPSG:4326&OUTPUTFORMAT=geojson&some_runtime_substitution_parameter=42
> {
> "type": "FeatureCollection",
> "name": "some_layer",
> "features": []
> }

This works as anticipated. What I didn't expect is that MapServer logs an error:
> msQueryByRect(): Search returned no results. No matching record(s) found

I think this code is being invoked: https://github.com/mapserver/mapserver/blob/master/mapquery.c#L1287-L1288

I do not think having no results should be considered an error. Is there a way to silence just this one type of error? I couldn't find anything obvious other than other than redirecting stderr to /dev/null or remove it via grep/sed.
Thanks,
Pete


_______________________________________________
mapserver-users mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/mapserver-users


--
Pete

_______________________________________________
mapserver-users mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/mapserver-users