You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+91-1Lines changed: 91 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,12 +3,91 @@
3
3
4
4
Rails Semantic Logger replaces the Rails default logger with [Semantic Logger](https://logger.rocketjob.io/)
5
5
6
+
When any large Rails application is deployed to production one of the first steps is to move to centralized logging, so that logs can be viewed and searched from a central location.
7
+
8
+
Centralized logging quickly falls apart when trying to consume the current human readable log files:
9
+
- Log entries often span multiple lines, resulting in unrelated log lines in the centralized logging system. For example, stack traces.
10
+
- Complex Regular Expressions are needed to parse the text lines and make them machine readable. For example to build queries, or alerts that are looking for specific elements in the message.
11
+
- Writing searches, alerts, or dashboards based on text logs is incredibly brittle, since a small change to the text logged can often break the parsing of those logs.
12
+
- Every log entry often has a completely different format, making it difficult to make consistent searches against the data.
13
+
14
+
For these and many other reasons switching to structured logging, or logs in JSON format, in testing and production makes centralized logging incredibly powerful.
15
+
16
+
For example, adding these lines to `config/application.rb` and removing any other log overrides from other environments, will switch automatically to structured logging when running inside Kubernetes:
For complete documentation see: https://logger.rocketjob.io/rails
11
84
85
+
## Upgrading to Semantic Logger v4.15 - Sidekiq Support
86
+
87
+
Rails Semantic Logger introduces direct support for Sidekiq v4, v5, v6, and v7.
88
+
Please remove any previous custom patches or configurations to make Sidekiq work with Semantic Logger.
89
+
To see the complete list of patches being made, and to contribute your own changes, see: [Sidekiq Patches](https://github.com/reidmorrison/rails_semantic_logger/blob/master/lib/rails_semantic_logger/extensions/sidekiq/sidekiq.rb)
90
+
12
91
## Upgrading to Semantic Logger v4.4
13
92
14
93
With some forking frameworks it is necessary to call `reopen` after the fork. With v4.4 the
@@ -19,7 +98,18 @@ I.e. Please remove the following line if being called anywhere:
The primary purpose of the Rails Semantic Logger gem is to patch other gems, primarily Rails, to make them support structured logging though Semantic Logger.
104
+
105
+
When new versions of Rails and other gems are published they often make changes to the internals, so the existing patches stop working.
106
+
107
+
Rails Semantic Logger survives only when someone in the community upgrades to a newer Rails or other supported libraries, runs into problems,
108
+
and then contributes the fix back to the community by means of a pull request.
109
+
110
+
Additionally, when new popular gems come out, we rely only the community to supply the necessary patches in Rails Semantic Logger to make those gems support structured logging.
111
+
112
+
## Supported Platforms
23
113
24
114
For the complete list of supported Ruby and Rails versions, see the [Testing file](https://github.com/reidmorrison/rails_semantic_logger/blob/master/.github/workflows/ci.yml).
0 commit comments