scouech
(scouech)
May 6, 2021, 4:08pm
1
Hey!
Here is my current log directive
log {
output file /var/log/caddy/access.json {
roll_size 10MB
roll_keep 5
roll_keep_for 240h
format console
}
What I would like to do is to log only requests with the code 400 and above.
Is that possible? I looked at the doc but I’m not sure!
(Sorry I come from nginx and it’s a bit of a change for me!)
Thank you!
matt
(Matt Holt)
May 6, 2021, 4:27pm
2
Nope, just ignore the other log entries or have another tool filter them out for you.
scouech
(scouech)
May 6, 2021, 4:27pm
3
would the level parameter filter them out / return only specific ones?
scouech
(scouech)
May 6, 2021, 4:35pm
4
I’ve found this:
1. Caddy version (caddy version):
v2.1.1
2. How I run Caddy:
Official docker container
3. The problem I’m having:
Followng up on a previous question (How to disable specific logs? ) where I discovered that by reading the docs you can actually learn something (a self-RTFM of sorts, specifically how to configure logging for a given site), I am now wondering whether it is possible to set up a default logging level.
All the docs I saw point to How Logging Works — Caddy Documentation and log (Ca…
It’s not allowing me to filter perfectly, but at least I can change the level
to warn
and code 200
will not be logged
system
(system)
Closed
June 5, 2021, 4:09pm
5
This topic was automatically closed after 30 days. New replies are no longer allowed.