[Pywps-dev] Deactivate sqlalchemy logging
Jáchym Čepický
jachym.cepicky at gmail.com
Mon Dec 26 07:50:46 PST 2016
Hi,
I've just tested fresh PyWPS deployment and to me it seems, everything
works ok.
In your configuration file, the [logging] section must be defined:
[logging]
level=INFO
file=logs/pywps.log
database=sqlite:///logs/pywps-logs.sqlite3
If `level` is set to `INFO`, the `echo` of sqalchemy will be set to `False`
`file` stands for the file where logging should go
`database` is needed for storing and resuming running jobs
Sqalchemy is printing the debugging information to STDOUT - it will not
appear in either configured log file, instead it will appear in server
error.log file
Maybe your configuration file is not configured well. Does it help to
change the title of PyWPS instance in the configuration file? Will
Capabilities document contain changed title?
J
Dne 23.12.2016 v 23:37 Sylvain Beorchia napsal(a):
> No.
>
> Seems like my pywps.cfg is ignored. I checked my all drive, i've got only
> one pywps.cfg. You can see it there :
>
> https://friendpaste.com/26jVmZ4v26KAzEP0ptyZ6i
>
> I haven't changed lots of things, and somes settings are incorrect (for
> exemple : serveraddress=http://localhost/cgi-bin/wps). I use my wps server
> with wsgi, configured via apache.
> Is it possible that other settings cause a bad reading of the logging
> section ?
>
>
>
>
>
> 2016-12-23 23:08 GMT+01:00 Jáchym Čepický <jachym.cepicky at gmail.com>:
>
>> So
>>
>> try 'WARNING'
>>
>> did it help?
>>
>> J
>>
>> Dne 23.12.2016 v 23:06 Sylvain Beorchia napsal(a):
>>
>> Hi Jachym,
>>>
>>> Mmm not sure to well understand.
>>> According to the doc, level=INFO is the default.
>>> In dblog.py, we have :
>>>
>>> ...
>>> level = configuration.get_config_value('logging', 'level')
>>> if level in ['INFO']:
>>> echo = False
>>> try:
>>> engine = sqlalchemy.create_engine(database, echo=echo)
>>> ...
>>>
>>> If we set level = INFO (which is default), log shouldn't be activated. I
>>> don't understand.
>>> Anyway, i've tried the force the setting to INFO:
>>>
>>> [logging]
>>> level=INFO
>>>
>>> and no luck. I still have got lots of logs.
>>>
>>>
>>> I'm going to try to debug that.
>>>
>>> Sylvain.
>>>
>>>
>>>
>>> 2016-12-23 16:53 GMT+01:00 Jáchym Čepický <jachym.cepicky at gmail.com>:
>>>
>>> Hi,
>>>>
>>>> sorry for later response
>>>>
>>>> in PyWPS configuration file, you can set log level to anything but INFO -
>>>> in that case, in dblog.py
>>>>
>>>> 172 engine = sqlalchemy.create_engine(database, echo=echo_level)
>>>>
>>>> echo_level will be set to False
>>>>
>>>> See
>>>>
>>>> http://pywps.readthedocs.io/en/latest/configuration.html#logging
>>>>
>>>> for how to set this in configuration file
>>>>
>>>> Is that ok?
>>>>
>>>> Jachym
>>>>
>>>> Dne 16.12.2016 v 09:41 Sylvain Beorchia napsal(a):
>>>>
>>>> Hi all,
>>>>>
>>>>> Using my firsts pywps processes, i've got plenty of unwanted logs.
>>>>> Here's
>>>>> an extract :
>>>>>
>>>>> ...
>>>>> [Fri Dec 16 09:34:36.637934 2016] [:error] [pid 27598]
>>>>> INFO:sqlalchemy.engine.base.Engine:
>>>>> [Fri Dec 16 09:34:36.637937 2016] [:error] [pid 27598] CREATE TABLE
>>>>> pywps_stored_requests (
>>>>> [Fri Dec 16 09:34:36.637938 2016] [:error] [pid 27598] \tuuid
>>>>> VARCHAR(255)
>>>>> NOT NULL,
>>>>> [Fri Dec 16 09:34:36.637940 2016] [:error] [pid 27598] \trequest BLOB
>>>>> NOT
>>>>> NULL,
>>>>> [Fri Dec 16 09:34:36.637942 2016] [:error] [pid 27598] \tPRIMARY KEY
>>>>> (uuid)
>>>>> [Fri Dec 16 09:34:36.637944 2016] [:error] [pid 27598] )
>>>>> [Fri Dec 16 09:34:36.637946 2016] [:error] [pid 27598]
>>>>> [Fri Dec 16 09:34:36.637947 2016] [:error] [pid 27598]
>>>>> [Fri Dec 16 09:34:36.637998 2016] [:error] [pid 27598] 2016-12-16
>>>>> 09:34:36,637 INFO sqlalchemy.engine.base.Engine ()
>>>>> [Fri Dec 16 09:34:36.638017 2016] [:error] [pid 27598]
>>>>> INFO:sqlalchemy.engine.base.Engine:()
>>>>> [Fri Dec 16 09:34:36.638229 2016] [:error] [pid 27598] 2016
>>>>> ...
>>>>>
>>>>> I tried to deactivate the logging by doing :
>>>>>
>>>>> logging.basicConfig()
>>>>> logging.getLogger('sqlalchemy.engine').setLevel(logging.WARNING)
>>>>>
>>>>> in my wsgi file, but does no work.
>>>>>
>>>>> Am i missing something ?
>>>>>
>>>>> Thank you.
>>>>>
>>>>> Sylvain.
>>>>>
>>>>>
>>>>>
>>>>> _______________________________________________
>>>>> pywps-dev mailing list
>>>>> pywps-dev at lists.osgeo.org
>>>>> http://lists.osgeo.org/mailman/listinfo/pywps-dev
>>>>>
>>>>>
>>>>> --
>>>> Jachym Cepicky
>>>> e-mail: jachym.cepicky at gmail.com
>>>> twitter: @jachymc
>>>>
>>>>
>>>
>> --
>> Jachym Cepicky
>> e-mail: jachym.cepicky at gmail.com
>> twitter: @jachymc
>>
>
--
Jachym Cepicky
e-mail: jachym.cepicky at gmail.com
twitter: @jachymc
More information about the pywps-dev
mailing list