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
Change storage/queue/format fields to Symbol and enable JSON logging for all test runs
Breaking changes for v0.1.3:
- Changed storage, queue_name, and format fields from String to Symbol type to match Rails conventions
- JSON logging now enabled for all test runs (both local and CI) to ensure tests catch production bugs
This ensures local tests match CI behavior and catch serialization issues early. Updated all schemas, regenerated log structs, fixed Sorbet type errors in tests, and updated documentation.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: README.md
+3-4Lines changed: 3 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,7 +6,7 @@ We support all your other favorite gems too, like Sidekiq, Sentry, and Shrine. (
6
6
7
7
## Features
8
8
9
-
- JSON logging enabled by default for server processes in production and test environments, and for CI test runs (automatically disabled for console, local tests, and other Rake tasks)
9
+
- JSON logging enabled by default for server processes in production and test environments(automatically disabled for console and other Rake tasks)
10
10
- ActionMailer integration for email delivery logging
11
11
- ActiveJob integration for job execution logging
12
12
- Sidekiq integration for background job logging
@@ -61,8 +61,7 @@ Once initialized (and enabled), the gem automatically includes its modules into
61
61
### Default behavior by process type
62
62
63
63
-**Server processes** (`rails server`): JSON logging is enabled by default in production and test environments
64
-
-**CI test runs** (`rails test` when `CI=true`): JSON logging is enabled by default to catch production bugs in your automated tests
65
-
-**Local test runs** (`rails test` locally): JSON logging is disabled by default, providing human-readable logs for debugging
64
+
-**Test runs** (`rails test`): JSON logging is enabled by default in test environment to ensure tests catch production bugs
66
65
-**Console** (`rails console`): JSON logging is disabled by default in all environments, providing human-readable logs instead
67
66
-**Other Rake tasks** (`rake db:migrate`, etc.): JSON logging is disabled by default in production, providing human-readable logs instead
68
67
-**Development environment**: Disabled by default for all process types. Enable explicitly via `LOGSTRUCT_ENABLED=true` or `LogStruct.configure { |c| c.enabled = true }`.
@@ -76,7 +75,7 @@ LogStruct.configure do |c|
76
75
end
77
76
```
78
77
79
-
To force JSON logs in console, local test runs, or other Rake tasks (e.g., for debugging), set `LOGSTRUCT_ENABLED=true` in your environment.
78
+
To force JSON logs in console or other Rake tasks (e.g., for debugging), set `LOGSTRUCT_ENABLED=true` in your environment.
@@ -78,7 +76,7 @@ export default function ConfigurationPage() {
78
76
<code>LOGSTRUCT_ENABLED=false</code> to disable completely.
79
77
<divclassName="mt-2">
80
78
<CodeBlocklanguage="bash">
81
-
{`# Force JSON logs in console for debugging\nLOGSTRUCT_ENABLED=true rails console\n\n# Force JSON logs in local tests\nLOGSTRUCT_ENABLED=true rails test`}
79
+
{`# Force JSON logs in console for debugging\nLOGSTRUCT_ENABLED=true rails console\n\n# Disable JSON logs in tests (not recommended)\nLOGSTRUCT_ENABLED=false rails test`}
82
80
</CodeBlock>
83
81
</div>
84
82
</li>
@@ -155,13 +153,13 @@ end`}
155
153
</Callout>
156
154
157
155
<Callouttype="info">
158
-
To force JSON logs in console, local test runs, or other Rake tasks
159
-
(e.g., for debugging or inspecting the exact JSON output), set{' '}
156
+
To force JSON logs in consoleor other Rake tasks (e.g., for debugging
157
+
or inspecting the exact JSON output), set{' '}
160
158
<code>LOGSTRUCT_ENABLED=true</code> when running the command:
{`LogStruct is now installed and will automatically enable JSON structured logging for server processes in the test and production environments, and for CI test runs. Console, local tests, and other Rake tasks will use human-readable logs by default.`}
32
+
{`LogStruct is now installed and will automatically enable JSON structured logging for test runs and server processes in production environments. Console and other Rake tasks will use human-readable logs by default.`}
0 commit comments