3liz / docker-qgis-server

Build docker qgis tornado server image
6 stars 1 forks source link

How to see debug log files? #8

Closed lucamanga closed 5 years ago

lucamanga commented 5 years ago

Hi,

it would be nice to have a documentation on how to see the qgis server debug log from the container

thank you :)

dmarteau commented 5 years ago

Logs are output by default on stdout and so delegated to container management. You can see the logs of a running container with: docker logs -f <container>

Have a look to docker documentation for options in log management and log drivers:

lucamanga commented 5 years ago

I'm starting your container with this command:

docker run -d -p 8080:8080 \
        [...]
        -e QGSRV_LOGGING_LEVEL=DEBUG  \
        [...]
        3liz/qgis-map-server:3.4

but with docker logs -f I'm not seeing the log of each WMS request, only the initialization of the container...

dmarteau commented 5 years ago

All logs output goes to the console.

At start (in DEBUG mode) you should have the last lines as something like:

.... 
2019-06-19 09:26:38,864 INFO    [29]    Qgis: Server: Server initialized
2019-06-19 09:26:38,864 INFO    [29]    Connecting to ipc:///tmp/qgssrv/broker/pool0
2019-06-19 09:26:38,866 INFO    [29]    Identity set to b'W7\xfe:\x92t\x11\xe9\xb9]\x02B\xac\x11\x00\x02'
2019-06-19 09:26:38,866 INFO    [29]    Enabling broadcast notification
2019-06-19 09:26:38,868 INFO    [29]    Starting ZMQ worker loop
2019-06-19 09:26:38,868 DEBUG   [21]    READY b'W7\xfe:\x92t\x11\xe9\xb9]\x02B\xac\x11\x00\x02'

The request '/' must generate the following log entry

2019-06-19 09:48:32,041 REQ [1] 172.17.0.1  200 GET /   0   699 Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:67.0) Gecko/20100101 Firefox/67.0
lucamanga commented 5 years ago

Here are my results:

  1. Doing docker run -it .., it works correctly;
  2. Doing docker run -d .., it shows the request only of the first request and all the following are not logged
dmarteau commented 5 years ago

Doing docker run -it .., it works correctly

So the qgis server logging works as expected

Doing docker run -d .., it shows the request only of the first request and all the following are not logged

With docker in background mode run -d ... it is not expected that you have any output. Once your docker in background mode, what is the exact output of docker logs -f <container_id> ?

lucamanga commented 5 years ago

Uuuuh... I restarted the server and it all worked perfectly! Sorry, closing this issue