granian
granian copied to clipboard
static file request not reported in access log
I am running a Django application (locally) with something like the following:
granian --host 0.0.0.0 --port 8000 --access-log --static-path-route /static --static-path-mount /tmp/static/ --interface asginl my.app.asgi:application
As you can see from the options - I am using Granian to server static files (successfully), and I have the access logging turned on. It seem that requests for static files are not included in the access log.
I noticed this as I initially misconfigured it and was trying to determine why file were not being server - but there was nothing in the access logs (or the regular logs either - even with the level set to debug).
Correct, the current implementation doesn't write to access logs. The main thing is that the access log is handled by Python, whereas static files serving happens in Rust code only. I might find a way to call the access log from within the current code, but it might take a while to figure out the best way to do so.
Taking a while is fine - this initially came up as I misconfigured things (a trailing / on one of the command line switch - I forget which). It took me a little longer to work that out as there was nothing logged access or otherwise.
But needless to say but not rush - Granian is already pretty impressive!