g3w-suite / g3w-admin

Server module for G3W-SUITE
https://g3w-suite.readthedocs.io/en/latest/g3wsuite_administration.html
Mozilla Public License 2.0
39 stars 30 forks source link

Find out a way to filter out `GDAL_ERROR` and `Loading native module` from server logs #534

Open Raruto opened 1 year ago

Raruto commented 1 year ago

Checklist

Motivation

Surely those messages are there for a useful reason, but we should try to find a decrease console clogs.

Sometimes things get hard to find within all this duplication..

2023-04-21 14:23:23 GDAL_ERROR 1: b'Unable to find driver ECW to unload from GDAL_SKIP environment variable.'
2023-04-21 14:23:23 GDAL_ERROR 1: b'Unable to find driver ECW to unload from GDAL_SKIP environment variable.'
2023-04-21 14:23:23 GDAL_ERROR 1: b'Unable to find driver JP2ECW to unload from GDAL_SKIP environment variable.'
2023-04-21 14:23:24 GDAL_ERROR 1: b'Unable to find driver ECW to unload from GDAL_SKIP environment variable.'
2023-04-21 14:23:24 GDAL_ERROR 1: b'Unable to find driver ECW to unload from GDAL_SKIP environment variable.'
2023-04-21 14:23:24 GDAL_ERROR 1: b'Unable to find driver JP2ECW to unload from GDAL_SKIP environment variable.'
2023-04-21 14:23:24 GDAL_ERROR 1: b'Unable to find driver ECW to unload from GDAL_SKIP environment variable.'
2023-04-21 14:23:24 GDAL_ERROR 1: b'Unable to find driver ECW to unload from GDAL_SKIP environment variable.'
2023-04-21 14:23:24 GDAL_ERROR 1: b'Unable to find driver JP2ECW to unload from GDAL_SKIP environment variable.'
2023-04-21 14:23:24 QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-root'
2023-04-21 14:23:24 GDAL_ERROR 1: b'Unable to find driver ECW to unload from GDAL_SKIP environment variable.'
2023-04-21 14:23:24 GDAL_ERROR 1: b'Unable to find driver ECW to unload from GDAL_SKIP environment variable.'
2023-04-21 14:23:24 GDAL_ERROR 1: b'Unable to find driver JP2ECW to unload from GDAL_SKIP environment variable.'
2023-04-21 14:23:24 QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-root'
2023-04-21 14:23:24 "Loading native module /usr/lib/qgis/server/libdummy.so"
2023-04-21 14:23:24 "Loading native module /usr/lib/qgis/server/liblandingpage.so"
2023-04-21 14:23:24 "Loading native module /usr/lib/qgis/server/libwcs.so"
2023-04-21 14:23:24 "Loading native module /usr/lib/qgis/server/libwfs.so"
2023-04-21 14:23:24 "Loading native module /usr/lib/qgis/server/libwfs3.so"
2023-04-21 14:23:24 "Loading native module /usr/lib/qgis/server/libwms.so"
2023-04-21 14:23:24 "Loading native module /usr/lib/qgis/server/libwmts.so"
2023-04-21 14:23:24 "Loading native module /usr/lib/qgis/server/libdummy.so"
2023-04-21 14:23:24 "Loading native module /usr/lib/qgis/server/liblandingpage.so"
2023-04-21 14:23:24 "Loading native module /usr/lib/qgis/server/libwcs.so"
2023-04-21 14:23:24 "Loading native module /usr/lib/qgis/server/libwfs.so"
2023-04-21 14:23:24 "Loading native module /usr/lib/qgis/server/libwfs3.so"
2023-04-21 14:23:24 "Loading native module /usr/lib/qgis/server/libwms.so"
2023-04-21 14:23:24 "Loading native module /usr/lib/qgis/server/libwmts.so"
2023-04-21 14:23:25 "Loading native module /usr/lib/qgis/server/libdummy.so"
2023-04-21 14:23:25 "Loading native module /usr/lib/qgis/server/liblandingpage.so"
2023-04-21 14:23:25 "Loading native module /usr/lib/qgis/server/libwcs.so"
2023-04-21 14:23:25 "Loading native module /usr/lib/qgis/server/libwfs.so"
2023-04-21 14:23:25 "Loading native module /usr/lib/qgis/server/libwfs3.so"
2023-04-21 14:23:25 "Loading native module /usr/lib/qgis/server/libwms.so"
2023-04-21 14:23:25 "Loading native module /usr/lib/qgis/server/libwmts.so"
2023-04-21 14:23:25 "Loading native module /usr/lib/qgis/server/libdummy.so"
2023-04-21 14:23:25 "Loading native module /usr/lib/qgis/server/liblandingpage.so"
2023-04-21 14:23:25 "Loading native module /usr/lib/qgis/server/libwcs.so"
2023-04-21 14:23:25 "Loading native module /usr/lib/qgis/server/libwfs.so"
2023-04-21 14:23:25 "Loading native module /usr/lib/qgis/server/libwfs3.so"
2023-04-21 14:23:25 "Loading native module /usr/lib/qgis/server/libwms.so"
2023-04-21 14:23:25 "Loading native module /usr/lib/qgis/server/libwmts.so"
2023-04-21 14:23:26 GDAL_ERROR 1: b'Unable to find driver ECW to unload from GDAL_SKIP environment variable.'
2023-04-21 14:23:26 GDAL_ERROR 1: b'Unable to find driver ECW to unload from GDAL_SKIP environment variable.'
2023-04-21 14:23:26 GDAL_ERROR 1: b'Unable to find driver JP2ECW to unload from GDAL_SKIP environment variable.'
2023-04-21 14:23:26 QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-root'
2023-04-21 14:23:26 GDAL_ERROR 1: b'Unable to find driver ECW to unload from GDAL_SKIP environment variable.'
2023-04-21 14:23:26 GDAL_ERROR 1: b'Unable to find driver ECW to unload from GDAL_SKIP environment variable.'
2023-04-21 14:23:26 GDAL_ERROR 1: b'Unable to find driver JP2ECW to unload from GDAL_SKIP environment variable.'
2023-04-21 14:23:26 QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-root'
2023-04-21 14:23:26 "Loading native module /usr/lib/qgis/server/libdummy.so"
2023-04-21 14:23:26 "Loading native module /usr/lib/qgis/server/liblandingpage.so"
2023-04-21 14:23:26 "Loading native module /usr/lib/qgis/server/libwcs.so"
2023-04-21 14:23:26 "Loading native module /usr/lib/qgis/server/libwfs.so"
2023-04-21 14:23:26 "Loading native module /usr/lib/qgis/server/libwfs3.so"
2023-04-21 14:23:26 "Loading native module /usr/lib/qgis/server/libwms.so"
2023-04-21 14:23:26 "Loading native module /usr/lib/qgis/server/libwmts.so"
2023-04-21 14:23:26 "Loading native module /usr/lib/qgis/server/libdummy.so"
2023-04-21 14:23:26 "Loading native module /usr/lib/qgis/server/liblandingpage.so"
2023-04-21 14:23:26 "Loading native module /usr/lib/qgis/server/libwcs.so"
2023-04-21 14:23:26 "Loading native module /usr/lib/qgis/server/libwfs.so"
2023-04-21 14:23:26 "Loading native module /usr/lib/qgis/server/libwfs3.so"
2023-04-21 14:23:26 "Loading native module /usr/lib/qgis/server/libwms.so"
2023-04-21 14:23:27 "Loading native module /usr/lib/qgis/server/libwmts.so"
2023-04-21 14:23:28 GDAL_ERROR 1: b'Unable to find driver ECW to unload from GDAL_SKIP environment variable.'
2023-04-21 14:23:28 GDAL_ERROR 1: b'Unable to find driver ECW to unload from GDAL_SKIP environment variable.'
2023-04-21 14:23:28 GDAL_ERROR 1: b'Unable to find driver JP2ECW to unload from GDAL_SKIP environment variable.'
2023-04-21 14:23:28 GDAL_ERROR 1: b'Unable to find driver ECW to unload from GDAL_SKIP environment variable.'
2023-04-21 14:23:28 GDAL_ERROR 1: b'Unable to find driver ECW to unload from GDAL_SKIP environment variable.'
2023-04-21 14:23:28 GDAL_ERROR 1: b'Unable to find driver JP2ECW to unload from GDAL_SKIP environment variable.'
2023-04-21 14:23:28 "Loading native module /usr/lib/qgis/server/libdummy.so"
2023-04-21 14:23:28 "Loading native module /usr/lib/qgis/server/liblandingpage.so"
2023-04-21 14:23:28 "Loading native module /usr/lib/qgis/server/libwcs.so"
2023-04-21 14:23:29 "Loading native module /usr/lib/qgis/server/libwfs.so"
2023-04-21 14:23:29 "Loading native module /usr/lib/qgis/server/libwfs3.so"
2023-04-21 14:23:29 "Loading native module /usr/lib/qgis/server/libwms.so"
2023-04-21 14:23:29 "Loading native module /usr/lib/qgis/server/libwmts.so"
2023-04-21 14:23:29 "Loading native module /usr/lib/qgis/server/libdummy.so"
2023-04-21 14:23:29 "Loading native module /usr/lib/qgis/server/liblandingpage.so"
2023-04-21 14:23:29 "Loading native module /usr/lib/qgis/server/libwcs.so"
2023-04-21 14:23:29 "Loading native module /usr/lib/qgis/server/libwfs.so"
2023-04-21 14:23:29 "Loading native module /usr/lib/qgis/server/libwfs3.so"
2023-04-21 14:23:29 "Loading native module /usr/lib/qgis/server/libwms.so"
2023-04-21 14:23:29 "Loading native module /usr/lib/qgis/server/libwmts.so"

Suggested solution

  1. as per GDAL_ERROR I've found this topic: GDAL and Python - Don't print GDAL Error messages
  2. an alternative solution might be to print all those messages only once per server reboot (but really, I don't know how feasible it could be)

Alternatives considered

No response

wlorenzetti commented 1 year ago

as per GDAL_ERROR I've found this topic: GDAL and Python - Don't print GDAL Error messages

I don't know if this solution can be applied to G3W-SUITE python code, because I'm pretty sure that this GDAL_ERROR come from c++ QGIS-server code.