json_tagged_logger 0.8.0 → 0.8.2

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: 21f6070b94acf4230c68254797e06759ee1d75ca7b857054f3c95d7a872c3d8c
4
- data.tar.gz: 2fd59fe5624bfcdf4aa7d8e104d138e70c804e237ae8eacbbcc950172b2d53c8
3
+ metadata.gz: 60b65905b594568132848dd19437991995a95f753c4c17c0f4cccbed0ea93a4d
4
+ data.tar.gz: c27b8077f80957690b5208d3a1a4119be8c05d026c2a0bf0a4e3d7b223d8ec7f
5
5
  SHA512:
6
- metadata.gz: 8e9529f75a8ca997b6f074cf370001e147c4853a3eaac0d7e1a55dd46f5a358e685d1b09d17e8fc62d9f12b8a0c4a11194cdf59e50dfbac88314ed8c1e492805
7
- data.tar.gz: 8cc532c45f74566380a38ca5a71dc1fdbb3874bcdb8bdf3890be770aced174391b736b3951e0f6087fc70be6ade9c86e91a836ae0f47257e054de2e45c1f0c71
6
+ metadata.gz: 94d429b7283e5dd3e44ebc44d79611395c3bf1b47c2884709e81644a1e0e4a9813537f64f4649e4c55ea2c7184ad0b6797dc5b62f93654efe65577b46be6eb74
7
+ data.tar.gz: 0f0faa35d5544a9a9d73137a053a39453835c5ea3fbb7dde2b89b6666fe93393d3888f3dc8424ca6fcf781478d486116f29564d343a518b9fdbc8f6661259ccb
data/README.md CHANGED
@@ -1,6 +1,7 @@
1
1
  # JsonTaggedLogger
2
2
 
3
3
  [![Build Status](https://github.com/santry/json_tagged_logger/actions/workflows/ci.yml/badge.svg)](https://github.com/santry/json_tagged_logger/actions/workflows/ci.yml)
4
+ [![Gem Version](https://badge.fury.io/rb/json_tagged_logger.svg)](https://badge.fury.io/rb/json_tagged_logger)
4
5
 
5
6
  `JsonTaggedLogger` works in conjunction with [`ActiveSupport::TaggedLogging`](https://api.rubyonrails.org/classes/ActiveSupport/TaggedLogging.html) and (optionally) [Lograge](https://github.com/roidrage/lograge) to produce JSON-formatted log output. By itself, `ActiveSupport::TaggedLogging` supports simple tagging. With `JsonTaggedLogger`, you can compose key/value pairs, simple tags, and the log message itself into a single JSON document for easy consumption and parsing in log aggregators.
6
7
 
@@ -44,6 +45,7 @@ will get you something like
44
45
  ```json
45
46
  {
46
47
  "level": "INFO",
48
+ "time": "2025-02-04 18:56:44 +0300",
47
49
  "request_id": "914f6104-538d-4ddc-beef-37bfe06ca1c7",
48
50
  "host": "127.0.0.1",
49
51
  "my_param": "param value",
@@ -69,6 +71,7 @@ Importantly, if the controller action (or any code it calls along the way) has a
69
71
  ```json
70
72
  {
71
73
  "level": "INFO",
74
+ "time": "2025-02-04 18:56:44 +0300",
72
75
  "request_id": "914f6104-538d-4ddc-beef-37bfe06ca1c7",
73
76
  "host": "127.0.0.1",
74
77
  "my_param": "param value",
@@ -95,6 +98,7 @@ those will be added to the `tags` key in the JSON document
95
98
  ```json
96
99
  {
97
100
  "level": "INFO",
101
+ "time": "2025-02-04 18:56:44 +0300",
98
102
  "request_id": "914f6104-538d-4ddc-beef-37bfe06ca1c7",
99
103
  "host": "127.0.0.1",
100
104
  "my_param": "param value",
@@ -1,5 +1,5 @@
1
+ require 'active_support'
1
2
  require 'active_support/core_ext/hash/keys'
2
- require 'active_support/tagged_logging'
3
3
  require 'json'
4
4
 
5
5
  module JsonTaggedLogger
@@ -12,9 +12,10 @@ module JsonTaggedLogger
12
12
  @pretty_print = pretty_print
13
13
  end
14
14
 
15
- def call(severity, _time, _progname, message)
15
+ def call(severity, time, _progname, message)
16
16
  log = {
17
17
  level: severity,
18
+ time: time
18
19
  }
19
20
 
20
21
  json_tags, text_tags = extract_tags
@@ -1,5 +1,4 @@
1
1
  require 'active_support'
2
- require 'active_support/tagged_logging'
3
2
 
4
3
  module JsonTaggedLogger
5
4
  module Logger
@@ -1,3 +1,3 @@
1
1
  module JsonTaggedLogger
2
- VERSION = "0.8.0"
2
+ VERSION = "0.8.2"
3
3
  end
@@ -1,3 +1,4 @@
1
+ require 'logger'
1
2
  require 'json_tagged_logger/formatter'
2
3
  require 'json_tagged_logger/log_tags_config'
3
4
  require 'json_tagged_logger/logger'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: json_tagged_logger
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.0
4
+ version: 0.8.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sean Santry
@@ -115,7 +115,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
115
115
  - !ruby/object:Gem::Version
116
116
  version: '0'
117
117
  requirements: []
118
- rubygems_version: 3.5.16
118
+ rubygems_version: 3.5.22
119
119
  signing_key:
120
120
  specification_version: 4
121
121
  summary: JSON Tagged Log Formatter