[mapserver-users] php Mapscript logging

Waberzeck, Thomas Thomas.Waberzeck at liag-hannover.de
Wed Apr 6 01:16:00 PDT 2011


Hello,
I've got some questions about logging:

1. How do I avoid the logging if queryByPoint fails?
I use the following statement to query: 

if (@($this_layer->queryByPoint($querypoint, MS_SINGLE, 0)) == MS_SUCCESS) {.}

If nothing is found, I've got a message in my Mapserver logfile.
At map level debug is set off but I still get warnings.



2. How do I catch warnings i.e. if getLayerByName is called with a wrong layername?

try {
    $currLay = $map->getLayerByName($currLayName);
} catch (Exception $exc) {
    error_log('Layer '.$currLayName.' not found - Exception');
}catch (Error $e) {
    error_log('Layer '.$currLayName.' not found - Error');
}

Using the code above, php doesn't run into the catch statement.
Using "@" in the code above like 

[...]
$currLay = @$map->getLayerByName($currLayName);
[...]

nothing is logged...

Thanks


Thomas Waberzeck

Leibniz-Institut für Angewandte Geophysik (LIAG)
GEOZENTRUM HANNOVER
Stilleweg 2
30655 Hannover

Telefon +49 (0)511 643 3352
Telefax +49 (0)511 643 3665

Thomas.Waberzeck at liag-hannover.de




More information about the MapServer-users mailing list