[MapProxy] Enable logging
G. Wagner, Wagner-IT
info at wagner-it.de
Wed Apr 6 00:15:37 PDT 2022
Hey Tobias,
Thanks a lot. In order not to annoy the English community with German text
I'll try it further in English, or with Deepl. Maybe it is interesting for
other beginners.
With:
fileConfig(r'/data/mapproxy/log.ini', {'here': os.path.dirname(__file__)})
it worked. I had forgotten
"from logging.config import fileConfig" to comment it out :(
But I had one more question about the syntax. If I want to have the
logfiles in the subdirectory "logfiles" now, a works:
fileConfig(r'/data/mapproxy/log.ini', '/data/mapproxy/logfiles')
unfortunately not. How do I have to specify the path here?
I should probably take a closer look at Python.
Thanks and greetings
Günter
-----Ursprüngliche Nachricht-----
Von: Tobias Wendorff <tobias.wendorff at tu-dortmund.de>
Gesendet: Dienstag, 5. April 2022 17:26
An: G. Wagner, Wagner-IT <info at wagner-it.de>
Cc: mapproxy at lists.osgeo.org
Betreff: Re: [MapProxy] Enable logging
Hey Günter,
let me answer in German, since you stated your English would be poor.
Am 05.04.2022 um 16:30 schrieb G. Wagner, Wagner-IT:
> But how must the specification of " {'here':
> os.path.dirname(__file__)})"" look like?
`os.path.dirname(__file__)` liefert das Verzeichnis, in sich die gerade
ausgeführte Datei befindet. Bei `/opt/mapproxy/gwagner/test.py` würde dies
also `/opt/mapproxy/gwagner` ergeben.
Du kannst anstelle von `os.path.dirname(__file__)` auch einen direkten Pfad
als String oder Path-Objekt angeben, z.B. "/home/gwagner/logfiles".
Einige Leute verwenden gerne `os.path.normpath()` oder
`os.path.realpath()`, um den Pfadnamen zu säubern oder in absolute Pfade
umzuwandeln, das hilft oft beim Debugging.
HTH
Tobias
-------------- next part --------------
A non-text attachment was scrubbed...
Name: winmail.dat
Type: application/ms-tnef
Size: 3318 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/mapproxy/attachments/20220406/b6df6201/attachment.bin>
More information about the MapProxy
mailing list