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
+15-2Lines changed: 15 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -48,16 +48,29 @@ Please see the [documentation](https://logstruct.com/docs/configuration/) for co
48
48
49
49
### Important Notes on Integration
50
50
51
-
Once initialized, the gem automatically includes its modules into the appropriate base classes:
51
+
Once initialized (and enabled), the gem automatically includes its modules into the appropriate base classes:
52
52
53
-
-`ActiveSupport::TaggedLogging` is patched to support both Hashes and Strings
53
+
-`ActiveSupport::TaggedLogging` is patched to support both Hashes and Strings (only when LogStruct is enabled)
54
54
-`ActionMailer::Base` includes error handling and event logging modules
55
55
- We configure `Lograge` for request logging
56
56
- A Rack middleware is inserted to catch and log errors, including security violations (IP spoofing, CSRF, blocked hosts, etc.)
57
57
- Structured logging is set up for ActiveJob, Sidekiq, Shrine, etc.
58
58
- Rails `config.filter_parameters` are merged into LogStruct's filters and then cleared (to avoid double filtering). Configure sensitive keys via `LogStruct.config.filters`.
59
59
- When `RAILS_LOG_TO_STDOUT` is set, we log to STDOUT only. Otherwise, we log to STDOUT by default without adding a file appender to avoid duplicate logs.
60
60
61
+
### Development behavior
62
+
63
+
- Disabled by default in development. Enable explicitly via `LOGSTRUCT_ENABLED=true` or `LogStruct.configure { |c| c.enabled = true }`.
64
+
- When enabled in development, LogStruct now defaults to production‑style JSON output so you can preview exactly what will be shipped in prod.
65
+
- You can opt back into the colorful human formatter with:
66
+
67
+
```ruby
68
+
LogStruct.configure do |c|
69
+
c.integrations.prefer_json_in_development =false
70
+
c.integrations.enable_color_output =true
71
+
end
72
+
```
73
+
61
74
## Documentation
62
75
63
76
Please see the [documentation](https://logstruct.com/docs) for more details. (All code examples are type-checked and tested, and it's harder to keep a README up to date.)
0 commit comments