-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Caddyfile options to configure error log output #3958
Comments
@mholt thanks for taking a look at this. I may have some time to work on adding something like this, do you have any pointers or thoughts as to what the implementation path might look like? |
I'd recommend a global option syntax very similar to the
Where if omitted, And Maybe also a
The Caddyfile adapter should probably warn or error if there's a name conflict between a globally configured logger and a per-site logger (same names), because trying to merge them seems like a terrible idea. |
Seconding @francislavoie's suggestions. |
Would this include errors from reverse_proxy where transport is fastcgi? Still trying to get these logs on a per-host basis. |
I think you'll still need to use JSON config for that, because per-host logging requires the But you should be able to configure a logger that includes You would be better served by using |
Yeah, I think we already made the mistake of giving users some control over the logs that are emitted; all of that should really be done separate from the web server: you can drop logs on the floor right there or store them, but I made the web server too complicated. |
This filter is intended to be useful in scenarios where you may want to redact a value with a static string, giving you information that the field did previously exist and was present, but not revealing the value itself in the logs. This was inspired by work on adding more complete support for removing sensitive values from logs [1]. An example use case would be the Authorization header in request log output, for which the value should usually not be logged, but it may be quite useful for debugging to confirm that the header was present in the request. [1] caddyserver#3958
This change is aimed at enhancing the logging module within the Caddyfile directive to allow users to configure logs other than the HTTP access log stream, which is the current default. The intent here is to preserve the previous behavior and add optional abilites for richer configuration. Discussion for this approach happened in the referenced issue. Closes caddyserver#3958
Thanks for the suggestions! I've got a draft PR open here, let me know your thoughts: #3968 |
This filter is intended to be useful in scenarios where you may want to redact a value with a static string, giving you information that the field did previously exist and was present, but not revealing the value itself in the logs. This was inspired by work on adding more complete support for removing sensitive values from logs [1]. An example use case would be the Authorization header in request log output, for which the value should usually not be logged, but it may be quite useful for debugging to confirm that the header was present in the request. [1] caddyserver#3958
This change is aimed at enhancing the logging module within the Caddyfile directive to allow users to configure logs other than the HTTP access log stream, which is the current default. The intent here is to preserve the previous behavior and add optional abilites for richer configuration. Discussion for this approach happened in the referenced issue. Closes caddyserver#3958
This change is aimed at enhancing the logging module within the Caddyfile directive to allow users to configure logs other than the HTTP access log stream, which is the current default. The intent here is to preserve the previous behavior and add optional abilites for richer configuration. Discussion for this approach happened in the referenced issue. Closes caddyserver#3958
This filter is intended to be useful in scenarios where you may want to redact a value with a static string, giving you information that the field did previously exist and was present, but not revealing the value itself in the logs. This was inspired by work on adding more complete support for removing sensitive values from logs [1]. An example use case would be the Authorization header in request log output, for which the value should usually not be logged, but it may be quite useful for debugging to confirm that the header was present in the request. [1] caddyserver#3958
This change is aimed at enhancing the logging module within the Caddyfile directive to allow users to configure logs other than the HTTP access log stream, which is the current capability of the Caddyfile [1]. The intent here is to leverage the same syntax as the server log directive at a global level, so that similar customizations can be added without needing to resort to a JSON-based configuration. Discussion for this approach happened in the referenced issue. Closes caddyserver#3958 [1] https://caddyserver.com/docs/caddyfile/directives/log
This change is aimed at enhancing the logging module within the Caddyfile directive to allow users to configure logs other than the HTTP access log stream, which is the current capability of the Caddyfile [1]. The intent here is to leverage the same syntax as the server log directive at a global level, so that similar customizations can be added without needing to resort to a JSON-based configuration. Discussion for this approach happened in the referenced issue. Closes caddyserver#3958 [1] https://caddyserver.com/docs/caddyfile/directives/log
This filter is intended to be useful in scenarios where you may want to redact a value with a static string, giving you information that the field did previously exist and was present, but not revealing the value itself in the logs. This was inspired by work on adding more complete support for removing sensitive values from logs [1]. An example use case would be the Authorization header in request log output, for which the value should usually not be logged, but it may be quite useful for debugging to confirm that the header was present in the request. [1] caddyserver#3958
This change is aimed at enhancing the logging module within the Caddyfile directive to allow users to configure logs other than the HTTP access log stream, which is the current capability of the Caddyfile [1]. The intent here is to leverage the same syntax as the server log directive at a global level, so that similar customizations can be added without needing to resort to a JSON-based configuration. Discussion for this approach happened in the referenced issue. Closes caddyserver#3958 [1] https://caddyserver.com/docs/caddyfile/directives/log
This filter is intended to be useful in scenarios where you may want to redact a value with a static string, giving you information that the field did previously exist and was present, but not revealing the value itself in the logs. This was inspired by work on adding more complete support for removing sensitive values from logs [1]. An example use case would be the Authorization header in request log output, for which the value should usually not be logged, but it may be quite useful for debugging to confirm that the header was present in the request. [1] caddyserver#3958
This commit makes a structural change to the way arguments are passed to global options parsers in order to facilitate maintaining state and passing in additional parameters in the future, in a way that mirrors how handler directives are parsed, just simplified. The motivation to do this is to be able to keep state on which loggers have already been configured to prevent confusing configuration behaviors as part of the work on [1]. This functionality will be used in the next commit. [1] caddyserver#3958
This change is aimed at enhancing the logging module within the Caddyfile directive to allow users to configure logs other than the HTTP access log stream, which is the current capability of the Caddyfile [1]. The intent here is to leverage the same syntax as the server log directive at a global level, so that similar customizations can be added without needing to resort to a JSON-based configuration. Discussion for this approach happened in the referenced issue. Closes caddyserver#3958 [1] https://caddyserver.com/docs/caddyfile/directives/log
This change is aimed at enhancing the logging module within the Caddyfile directive to allow users to configure logs other than the HTTP access log stream, which is the current capability of the Caddyfile [1]. The intent here is to leverage the same syntax as the server log directive at a global level, so that similar customizations can be added without needing to resort to a JSON-based configuration. Discussion for this approach happened in the referenced issue. Closes caddyserver#3958 [1] https://caddyserver.com/docs/caddyfile/directives/log
This change is aimed at enhancing the logging module within the Caddyfile directive to allow users to configure logs other than the HTTP access log stream, which is the current capability of the Caddyfile [1]. The intent here is to leverage the same syntax as the server log directive at a global level, so that similar customizations can be added without needing to resort to a JSON-based configuration. Discussion for this approach happened in the referenced issue. Closes caddyserver#3958 [1] https://caddyserver.com/docs/caddyfile/directives/log
This change is aimed at enhancing the logging module within the Caddyfile directive to allow users to configure logs other than the HTTP access log stream, which is the current capability of the Caddyfile [1]. The intent here is to leverage the same syntax as the server log directive at a global level, so that similar customizations can be added without needing to resort to a JSON-based configuration. Discussion for this approach happened in the referenced issue. Closes caddyserver#3958 [1] https://caddyserver.com/docs/caddyfile/directives/log
This change is aimed at enhancing the logging module within the Caddyfile directive to allow users to configure logs other than the HTTP access log stream, which is the current capability of the Caddyfile [1]. The intent here is to leverage the same syntax as the server log directive at a global level, so that similar customizations can be added without needing to resort to a JSON-based configuration. Discussion for this approach happened in the referenced issue. Closes caddyserver#3958 [1] https://caddyserver.com/docs/caddyfile/directives/log
This change is aimed at enhancing the logging module within the Caddyfile directive to allow users to configure logs other than the HTTP access log stream, which is the current capability of the Caddyfile [1]. The intent here is to leverage the same syntax as the server log directive at a global level, so that similar customizations can be added without needing to resort to a JSON-based configuration. Discussion for this approach happened in the referenced issue. Closes caddyserver#3958 [1] https://caddyserver.com/docs/caddyfile/directives/log
This change is aimed at enhancing the logging module within the Caddyfile directive to allow users to configure logs other than the HTTP access log stream, which is the current capability of the Caddyfile [1]. The intent here is to leverage the same syntax as the server log directive at a global level, so that similar customizations can be added without needing to resort to a JSON-based configuration. Discussion for this approach happened in the referenced issue. Closes caddyserver#3958 [1] https://caddyserver.com/docs/caddyfile/directives/log
This change is aimed at enhancing the logging module within the Caddyfile directive to allow users to configure logs other than the HTTP access log stream, which is the current capability of the Caddyfile [1]. The intent here is to leverage the same syntax as the server log directive at a global level, so that similar customizations can be added without needing to resort to a JSON-based configuration. Discussion for this approach happened in the referenced issue. Closes caddyserver#3958 [1] https://caddyserver.com/docs/caddyfile/directives/log
This change is aimed at enhancing the logging module within the Caddyfile directive to allow users to configure logs other than the HTTP access log stream, which is the current capability of the Caddyfile [1]. The intent here is to leverage the same syntax as the server log directive at a global level, so that similar customizations can be added without needing to resort to a JSON-based configuration. Discussion for this approach happened in the referenced issue. Closes caddyserver#3958 [1] https://caddyserver.com/docs/caddyfile/directives/log
This change is aimed at enhancing the logging module within the Caddyfile directive to allow users to configure logs other than the HTTP access log stream, which is the current capability of the Caddyfile [1]. The intent here is to leverage the same syntax as the server log directive at a global level, so that similar customizations can be added without needing to resort to a JSON-based configuration. Discussion for this approach happened in the referenced issue. Closes #3958 [1] https://caddyserver.com/docs/caddyfile/directives/log
This filter is intended to be useful in scenarios where you may want to redact a value with a static string, giving you information that the field did previously exist and was present, but not revealing the value itself in the logs. This was inspired by work on adding more complete support for removing sensitive values from logs [1]. An example use case would be the Authorization header in request log output, for which the value should usually not be logged, but it may be quite useful for debugging to confirm that the header was present in the request. [1] #3958
This issue is a request to add functionality to the Caddyfile to configure the error log output in a similar manner to how the
log
directive [1] allows this for "access logs". I was motived to open this issue by some of the discussion here: #3744 (comment) which resonates with needs I have run into recently. I haven't been able to find a way to do this so far, which seems to be confirmed by this somewhat recent forum post: https://caddy.community/t/where-to-put-error-log-in-caddyfile/9896/2The specific situation I've seen motivating this request is that when you have an inbound request with sensitive headers set on it like
Cookie
orAuthorization
values that is routed to areverse_proxy
stanza, and if there is an error proxying the request to that backend service, you end up with an error message that looks like the following (I removed some of the default browser headers for simplicity):In this case, it would be a security issue to capture the value of
"Cookie": ["secret_session_id=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"]
in application logs on the server.I understand that it may be possible to exclude this type of log with the JSON config [2] but it would be quite convenient to do this with the Caddyfile.
The equivalent functionality in the access logs would be a
request>headers>Cookie delete
statement similar to the examples for the access log directive: https://caddyserver.com/docs/caddyfile/directives/log#examples[1] https://caddyserver.com/docs/caddyfile/directives/log
[2] https://caddyserver.com/docs/json/logging/
The text was updated successfully, but these errors were encountered: