diff options
| author | erdgeist <erdgeist@erdgeist.org> | 2026-07-19 16:16:43 +0200 |
|---|---|---|
| committer | erdgeist <erdgeist@erdgeist.org> | 2026-07-19 16:16:43 +0200 |
| commit | e0c2d7a066793683a911bee7f7210d80eb6b2055 (patch) | |
| tree | 91967742cbe245806776d0dd470ad7f4ec72abe0 /config/initializers | |
| parent | 042d99ec0e9095e46642d6f20932754025fd8af5 (diff) | |
Log CSP violations to their own file instead of relying on Rails.logger
Diffstat (limited to 'config/initializers')
| -rw-r--r-- | config/initializers/csp_log.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/config/initializers/csp_log.rb b/config/initializers/csp_log.rb new file mode 100644 index 0000000..1dde9c4 --- /dev/null +++ b/config/initializers/csp_log.rb | |||
| @@ -0,0 +1,4 @@ | |||
| 1 | # CSP violation reports get their own file, independent of config.logger. | ||
| 2 | CSP_LOGGER = Rails.env.production? ? | ||
| 3 | ActiveSupport::Logger.new(Rails.root.join("log", "csp_violations.log")) : | ||
| 4 | Rails.logger | ||
