Skip to content

Commit 3e987e6

Browse files
authored
Merge pull request #1 from xsnippet/access_log
Tweak the default acccess log format
2 parents f757b4b + 079a843 commit 3e987e6

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

xsnippet/web_backend/__main__.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,9 @@
1212

1313
# create an app instance and listen forever
1414
app = create_app(conf)
15-
aiohttp.web.run_app(app, host=conf.LISTEN_HOST, port=conf.LISTEN_PORT)
15+
aiohttp.web.run_app(
16+
app,
17+
host=conf.LISTEN_HOST,
18+
port=conf.LISTEN_PORT,
19+
access_log_format=conf.ACCESS_LOG_FORMAT
20+
)

xsnippet/web_backend/conf.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,5 @@
55

66
LISTEN_HOST = os.environ.get('XSNIPPET_WEB_PROXY_HOST', '0.0.0.0')
77
LISTEN_PORT = os.environ.get('XSNIPPET_WEB_PROXY_PORT', 5000)
8+
9+
ACCESS_LOG_FORMAT = os.environ.get('ACCESS_LOG_FORMAT', '%t %a "%r" %s %b "%{User-Agent}i" %Tf')

0 commit comments

Comments
 (0)