summaryrefslogtreecommitdiff
path: root/modules/logging
AgeCommit message (Collapse)Author
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 <leodidonato@gmail.com>
2021-06-04logging: Actually use `level_key` (#4189)Francis Lavoie
2021-05-19logging: Implement dial timeout for net writer (fix #4083) (#4172)Matt 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 <mholt@users.noreply.github.com>
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
2020-01-03v2: housekeeping: address minor lint complaints (#2957)Mohammed Al Sahaf
* v2: housekeeping: update tools * v2: housekeeping: adhere to US locale in spelling * v2: housekeeping: simplify code
2020-01-01logging: Little fix for filtering object fieldsMatthew Holt
2019-12-23Improve godocs all aroundMatthew Holt
These will be used in the new automated documentation system
2019-12-15logging: Implement net writer (#2884)Abdelmalek Ihdene
* Implement UDP writer * Implement Net Writer * Utilize Caddy's address parsing functions * A couple little fixes (see #2884)
2019-12-10v2: Module documentation; refactor LoadModule(); new caddy struct tags (#2924)Matt Holt
This commit goes a long way toward making automated documentation of Caddy config and Caddy modules possible. It's a broad, sweeping change, but mostly internal. It allows us to automatically generate docs for all Caddy modules (including future third-party ones) and make them viewable on a web page; it also doubles as godoc comments. As such, this commit makes significant progress in migrating the docs from our temporary wiki page toward our new website which is still under construction. With this change, all host modules will use ctx.LoadModule() and pass in both the struct pointer and the field name as a string. This allows the reflect package to read the struct tag from that field so that it can get the necessary information like the module namespace and the inline key. This has the nice side-effect of unifying the code and documentation. It also simplifies module loading, and handles several variations on field types for raw module fields (i.e. variations on json.RawMessage, such as arrays and maps). I also renamed ModuleInfo.Name -> ModuleInfo.ID, to make it clear that the ID is the "full name" which includes both the module namespace and the name. This clarity is helpful when describing module hierarchy. As of this change, Caddy modules are no longer an experimental design. I think the architecture is good enough to go forward.
2019-11-11logging: Support placeholders in level and filename (#2872)Sarat Chandra
* Add support for placeholders in Config Fixes #2870 * Replace placeholders only in logging config. Placeholders in log level and filename incase of file output are replaced. * Add Provision to filewriter module for replacing placeholders
2019-10-28v2: Logging! (#2831)Matt Holt
* logging: Initial implementation * logging: More encoder formats, better defaults * logging: Fix repetition bug with FilterEncoder; add more presets * logging: DiscardWriter; delete or no-op logs that discard their output * logging: Add http.handlers.log module; enhance Replacer methods The Replacer interface has new methods to customize how to handle empty or unrecognized placeholders. Closes #2815. * logging: Overhaul HTTP logging, fix bugs, improve filtering, etc. * logging: General cleanup, begin transitioning to using new loggers * Fixes after merge conflict