event_logger_rails 0.3.0 → 0.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 110cf01af709d86d2e848b9d11363ca58a0ab433eb444c05b9e9044d22ed35a3
4
- data.tar.gz: 4b338f9e6f937e16195fc6f184bbad7e376409dcf44e545c50c3cec101b58123
3
+ metadata.gz: 13e98d21b691d869d533906e17ff9cd6b7cc4dc9fe53c3956233659c7b8f2f5b
4
+ data.tar.gz: e8320f015f1e3840304c532b7bd951676a36e5cedca3d7b2967d3a40119a36a1
5
5
  SHA512:
6
- metadata.gz: 46be7cf18342e29d39b60f7cc4858858b5b880f16f049d65d89f69dccc0f0add12053be5020d6856a8db059f75f7f7b86f05e7733a55cadda3b3ed83dfe1e9c5
7
- data.tar.gz: e69a33c9979e4bea40ec4ed0c723821c574586ab6a6ac29cea0f8e181fc0c545acf763b985d69b98899c5b2336262add45055479c3411673fc87ce20f760bc6f
6
+ metadata.gz: 0c892160afbb1b52c6875605bb9c578db3cb03b28b074bdd08d611753b62593edf7cafbf5dbe7928022f4dae22b55a4889ef20711aac6a460bfda2618f383527
7
+ data.tar.gz: af73afed340dcdd9a296fd86fec42574c05f4bb47171c3a0c43d9f0247faba8aebf86d2004d50447074bb89ca956b5bbbc7f1fd8ef2613944ec04e453a7ed842
data/README.md CHANGED
@@ -344,6 +344,17 @@ Rails.application.configure do |config|
344
344
  end
345
345
  ```
346
346
 
347
+ You can also configure the Rails logger to use `EventLoggerRails::JsonLogger` to render structured logs in JSON format with the additional app and request data.
348
+
349
+ ```ruby
350
+ Rails.application.configure do
351
+ config.colorize_logging = false
352
+ config.log_level = ENV.fetch('RAILS_LOG_LEVEL', :info)
353
+ logger = EventLoggerRails::JsonLogger.new($stdout)
354
+ config.logger = ActiveSupport::TaggedLogging.new(logger)
355
+ end
356
+ ```
357
+
347
358
  ## Contributing
348
359
 
349
360
  Your inputs echo in this realm. Venture forth and materialize your thoughts through a PR.
@@ -4,6 +4,8 @@ module EventLoggerRails
4
4
  ##
5
5
  # Writes log entries in JSON format
6
6
  class JsonLogger < ::Logger
7
+ include ActiveSupport::LoggerSilence
8
+
7
9
  def initialize(...)
8
10
  super(...)
9
11
  @formatter = proc do |level, timestamp, _progname, message|
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module EventLoggerRails
4
- VERSION = '0.3.0'
4
+ VERSION = '0.3.1'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: event_logger_rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dick Davis
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-10-06 00:00:00.000000000 Z
11
+ date: 2023-10-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails