Age | Commit message (Collapse) | Author |
|
* core: Implement FastAbs to avoid repeated os.Getwd calls
* Lint
* Rename files
|
|
101d3e7 introduced a configuration option to set the log file mode.
This option was not taken into account if the file already exists,
making users having to delete their logs to have new logs created
with the right mode.
|
|
|
|
Commit 101d3e7 introduced file mode setting,
but was missing a JSON Marshaller so that
CaddyFile can be converted to JSON safely.
|
|
Adding a "mode" option to overwrite the default logfile permissions.
Default remains "0600" which is the one currently used by lumberjack.
|
|
|
|
* logging: Implement `add` encoder
* Allow flatter config structure for `filter` & `add`
* Rename to append
* govulncheck was unhappy
|
|
|
|
Co-authored-by: Kévin Dunglas <[email protected]>
|
|
|
|
Co-authored-by: Matt Holt <[email protected]>
Co-authored-by: Francis Lavoie <[email protected]>
|
|
Fixes https://caddy.community/t/is-caddy-mutating-header-content-from-logging-settings/20947
|
|
* use gofmput to format code
* use gci to format imports
* reconfigure gci
* linter autofixes
* rearrange imports a little
* export GOOS=windows golangci-lint run ./... --fix
|
|
|
|
|
|
If enabled and there is an error when opening the net writer, ignore the
error and report it along with subsequent logs to stderr.
|
|
* reverseproxy: Mask the WS close message when we're the client
* weakrand
* Bump golangci-lint version so path ignores work on Windows
* gofmt
* ugh, gofmt everything, I guess
|
|
* logging: Perform filtering on arrays of strings (where possible)
* Add test for ip_mask filter
* Oops, need to continue when it's not an IP
* Test for invalid IPs
|
|
|
|
This is something that has bothered me for a while, so I figured I'd do something about it now since I'm playing in the logging code lately.
The `console` encoder doesn't actually match the defaults that zap's default logger uses. This makes it match better with the rest of the logs when using the `console` encoder alongside somekind of filter, which requires you to configure an encoder to wrap.
|
|
|
|
|
|
|
|
Somehow, this was missed. Oops!
|
|
|
|
|
|
* logging: add support for hashing data
* Update modules/logging/filters.go
Co-authored-by: wiese <[email protected]>
* Update modules/logging/filters.go
Co-authored-by: wiese <[email protected]>
Co-authored-by: wiese <[email protected]>
|
|
|
|
|
|
* feat(logging): add a filter for cookies
* Improve godoc and add validation
|
|
Co-authored-by: Matt Holt <[email protected]>
Co-authored-by: Francis Lavoie <[email protected]>
|
|
|
|
See https://github.com/caddyserver/caddy/issues/4148#issuecomment-833207811
|
|
Signed-off-by: Leonardo Di Donato <[email protected]>
|
|
|
|
* logging: Implement dial timeout for net writer (fix #4083)
* Limit how often redials are attempted
This should cause dial blocking to occur only once every 10 seconds at most, but it also means the logger connection might be down for up to 10 seconds after it comes back online; oh well. We shouldn't block for DialTimeout at every single log emission.
* Clarify offline behavior
|
|
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] https://github.com/caddyserver/caddy/issues/3958
|
|
Has been deprecated for about 6 months now because it is broken.
|
|
Eliminates a fair amount of repeated code
|
|
|
|
* logging: Implement Caddyfile support for filter encoder
* logging: Add support for parsing IP masks from strings
wip
* logging: Implement Caddyfile support for ip_mask
* logging: Get rid of unnecessary logic to allow strings, not that useful
* logging: Add adapt test
|
|
It is essentially broken because it occludes many log fields.
See: https://github.com/caddyserver/caddy/issues/3575
|
|
|
|
* logging: Net writer redials if write fails
https://caddy.community/t/v2-log-output-net-does-not-reconnect-after-lost-connection/8386?u=matt
* Only replace connection if redial succeeds
* Fix error handling
|
|
* caddy: Add support for `d` duration unit
* Improvements to ParseDuration; add unit tests
Co-authored-by: Matthew Holt <[email protected]>
|
|
* For `roll_size` and `roll_keep_for` directives, round up instead of down.
For example, if a user wants to be able to look back on 36 hours of logs,
but you must round to a 24-hour multiple, then it's better to round up to
48 hours (which includes the desired 36 hours) instead of down to 24 hours.
* `roll_size` had an off-by-one error that caused the size to be as much as
1 MB larger than requested. For example, requests of `1MB` and `1.1MB`
both became 2 MB. Now `1MB` means 1 MB, and `1.1MB` is rounded up to 2 MB.
|
|
|
|
"10mb" now results in 10, rather than 9.
|
|
* httpcaddyfile: Begin implementing log directive, and debug mode
For now, debug mode just sets the log level for all logs to DEBUG
(unless a level is specified explicitly).
* httpcaddyfile: Finish 'log' directive
Also rename StringEncoder -> SingleFieldEncoder
* Fix minor bug in replacer (when vals are empty)
|
|
|