aboutsummaryrefslogtreecommitdiffhomepage
path: root/modules/logging
AgeCommit message (Collapse)Author
2024-11-13core: Implement FastAbs to avoid repeated os.Getwd calls (#6687)Francis Lavoie
* core: Implement FastAbs to avoid repeated os.Getwd calls * Lint * Rename files
2024-06-12logging: set file mode when the file already exist (#6391)Ririsoft
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.
2024-06-10logging: Customizable zap cores (#6381)Omar Ramadan
2024-06-08logging: fix file mode configuration parsing (#6383)Ririsoft
Commit 101d3e7 introduced file mode setting, but was missing a JSON Marshaller so that CaddyFile can be converted to JSON safely.
2024-06-06logging: Customize log file permissions (#6314)Ririsoft
Adding a "mode" option to overwrite the default logfile permissions. Default remains "0600" which is the one currently used by lumberjack.
2024-03-21logging: support `ms` duration format and add docs (#6187)Mohammed Al Sahaf
2024-03-05logging: Implement `append` encoder, allow flatter filters config (#6069)Francis Lavoie
* logging: Implement `add` encoder * Allow flatter config structure for `filter` & `add` * Rename to append * govulncheck was unhappy
2024-02-12logging: Inline Caddyfile syntax for `ip_mask` filter (#6094)Francis Lavoie
2024-01-25logging: Automatic `wrap` default for `filter` encoder (#5980)Francis Lavoie
Co-authored-by: Kévin Dunglas <[email protected]>
2024-01-23caddyfile: Normalize & flatten all unmarshalers (#6037)Francis Lavoie
2023-08-29logging: query filter for array of strings (#5779)Paul Jeannot
Co-authored-by: Matt Holt <[email protected]> Co-authored-by: Francis Lavoie <[email protected]>
2023-08-29logging: Clone array on log filters, prevent side-effects (#5786)Francis Lavoie
Fixes https://caddy.community/t/is-caddy-mutating-header-content-from-logging-settings/20947
2023-08-14ci: use gci linter (#5708)Jacob Gadikian
* 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
2023-08-07ci: Use gofumpt to format code (#5707)Jacob Gadikian
2023-05-04logging: Actually honor the SoftStart parameterMatthew Holt
2023-05-04logging: Soft start for net writer (close #5520)Matthew Holt
If enabled and there is an error when opening the net writer, ignore the error and report it along with subsequent logs to stderr.
2022-11-14reverseproxy: Mask the WS close message when we're the client (#5199)Francis Lavoie
* 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
2022-10-04logging: Perform filtering on arrays of strings (where possible) (#5101)Francis Lavoie
* 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
2022-10-05logging: Add `time_local` option to use local time instead of UTC (#5108)Francis Lavoie
2022-10-04logging: Better `console` encoder defaults (#5109)Francis Lavoie
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.
2022-08-08logging: Fix `cookie` filter (#4943)Francis Lavoie
2022-08-02chore: Bump up to Go 1.19, minimum 1.18 (#4925)Francis Lavoie
2022-04-28logging: Implement rename filter, changes field key names (#4745)Francis Lavoie
2022-04-07logging: Caddyfile support for `duration_format` (#4684)Francis Lavoie
Somehow, this was missed. Oops!
2022-02-19logging: Add `roll_local_time` Caddyfile option (#4583)Francis Lavoie
2022-01-04logging: Support turning off roll compression via Caddyfile (#4505)Francis Lavoie
2021-12-02logging: add support for hashing data (#4434)Kévin Dunglas
* 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]>
2021-11-29logging: Remove common_log field and single_field encoder (#4149) (#4282)Matt Holt
2021-11-23logging: add a regexp filter (#4426)Kévin Dunglas
2021-11-23logging: add a filter for cookies (#4425)Kévin Dunglas
* feat(logging): add a filter for cookies * Improve godoc and add validation
2021-11-23logging: add a filter for query parameters (#4424)Kévin Dunglas
Co-authored-by: Matt Holt <[email protected]> Co-authored-by: Francis Lavoie <[email protected]>
2021-08-17logging: Warn for deprecated single_field encoderMatthew Holt
2021-07-14logging: Prep for `common_log` removal (#4149)Francis Lavoie
See https://github.com/caddyserver/caddy/issues/4148#issuecomment-833207811
2021-07-12logging: Add missing interface guards for replace filter (#4244)Leo Di Donato
Signed-off-by: Leonardo Di Donato <[email protected]>
2021-06-04logging: Actually use `level_key` (#4189)Francis Lavoie
2021-05-19logging: Implement dial timeout for net writer (fix #4083) (#4172)v2.4.1Matt Holt
* 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
2021-03-12logging: add replace filter for static value replacement (#4029)Aaron Taylor
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
2021-01-07logging: Remove logfmt encoder (close #3575)Matthew Holt
Has been deprecated for about 6 months now because it is broken.
2021-01-05caddyfile: Refactor unmarshaling of module tokensMatthew Holt
Eliminates a fair amount of repeated code
2020-11-02logging: Fix for IP filteringChristoph Kluge
2020-09-15logging: Implement Caddyfile support for filter encoder (#3578)Francis Lavoie
* 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
2020-07-13logging: ⚠️ Deprecate logfmt encoderMatthew Holt
It is essentially broken because it occludes many log fields. See: https://github.com/caddyserver/caddy/issues/3575
2020-05-29caddyconfig: Minor internal and godoc tweaksMatthew Holt
2020-05-28logging: Net writer redials if write fails (#3453)Matt Holt
* 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
2020-05-11core: Add support for `d` duration unit (#3323)Francis Lavoie
* caddy: Add support for `d` duration unit * Improvements to ParseDuration; add unit tests Co-authored-by: Matthew Holt <[email protected]>
2020-05-07log: improve rounding logic for log rolling directives (#3367)Jeremy Lin
* 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.
2020-04-07core: Rename ParsedAddress -> NetworkAddressMatthew Holt
2020-03-24logging: Fix off-by-one for roll size MB from CaddyfileMatthew Holt
"10mb" now results in 10, rather than 9.
2020-02-25v2: 'log' directive for Caddyfile, and debug mode (#3052)Matt Holt
* 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)
2020-01-03logging: Add doc about which fields can't be filteredMatthew Holt