Skip to content

Commit

Permalink
Fix access logs
Browse files Browse the repository at this point in the history
  • Loading branch information
sbrunner committed Dec 17, 2024
1 parent a7de9cc commit 075c5a2
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
5 changes: 4 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ ENV TILEGENERATION_CONFIGFILE=/etc/tilegeneration/config.yaml \
TILECLOUD_LOG_LEVEL=INFO \
C2CWSGIUTILS_LOG_LEVEL=WARN \
WAITRESS_LOG_LEVEL=INFO \
WSGI_LOG_LEVEL=INFO \
SQL_LOG_LEVEL=WARN \
OTHER_LOG_LEVEL=WARN \
VISIBLE_ENTRY_POINT=/ \
Expand All @@ -97,7 +98,9 @@ ENV TILEGENERATION_CONFIGFILE=/etc/tilegeneration/config.yaml \
TILE_CHUNK_SIZE=1 \
TILE_SERVER_LOGLEVEL=quiet \
TILE_MAPCACHE_LOGLEVEL=verbose \
WAITRESS_THREADS=10
WAITRESS_THREADS=10 \
PYRAMID_INCLUDES= \
DEBUGTOOLBAR_HOSTS=

EXPOSE 8080

Expand Down
16 changes: 14 additions & 2 deletions application.ini
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,13 @@ c2c.base_path = /c2c

tilegeneration_configfile = %(TILEGENERATION_CONFIGFILE)s

pyramid.includes = %(PYRAMID_INCLUDES)s
# Be careful when manipulate this,
# if a hacker has access to the debug toolbar,
# it's a severe security issue
# With the provided values, the debug toolbar is only available from the Docker network
debugtoolbar.hosts = %(DEBUGTOOLBAR_HOSTS)s

[filter:translogger]
use = egg:Paste#translogger
setup_console_handler = False
Expand All @@ -27,7 +34,7 @@ use = egg:PasteDeploy#prefix
prefix = %(VISIBLE_ENTRY_POINT)s

[pipeline:main]
pipeline = egg:c2cwsgiutils#client_info egg:c2cwsgiutils#sentry app
pipeline = translogger egg:c2cwsgiutils#client_info egg:c2cwsgiutils#sentry app

[server:main]
use = egg:waitress#main
Expand All @@ -42,7 +49,7 @@ clear_untrusted_proxy_headers = False
###

[loggers]
keys = root, waitress, c2cwsgiutils, tilecloud, tilecloud_chain, sqlalchemy
keys = root, waitress, wsgi, c2cwsgiutils, tilecloud, tilecloud_chain, sqlalchemy

[handlers]
keys = console, json
Expand Down Expand Up @@ -78,6 +85,11 @@ qualname = sqlalchemy.engine
# "level = DEBUG" logs SQL queries and results.
# "level = WARN" logs neither. (Recommended for production systems.)

[logger_wsgi]
level = %(WSGI_LOG_LEVEL)s
handlers =
qualname = wsgi

[logger_waitress]
level = %(WAITRESS_LOG_LEVEL)s
handlers =
Expand Down

0 comments on commit 075c5a2

Please sign in to comment.