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
Make logger dependencies optional and add stdlib Logger support
- Move semantic_logger from runtime to development dependency
- Make semantic_logger optional with graceful fallback
- Add stdlib Logger integration via stdlib_formatter method
- Update README with stdlib Logger documentation
- Improves flexibility for customer integration by removing required dependencies
🤖 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
+25-1Lines changed: 25 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -66,7 +66,11 @@ end
66
66
67
67
## Dynamic Log Levels
68
68
69
-
Reforge supports dynamic log level management through SemanticLogger integration. This allows you to change log levels in real-time without redeploying your application.
69
+
Reforge supports dynamic log level management for Ruby logging frameworks. This allows you to change log levels in real-time without redeploying your application.
70
+
71
+
Supported loggers:
72
+
- SemanticLogger (optional dependency)
73
+
- Ruby stdlib Logger
70
74
71
75
### Setup with SemanticLogger
72
76
@@ -127,6 +131,26 @@ on_worker_boot do
127
131
end
128
132
```
129
133
134
+
### With Ruby stdlib Logger
135
+
136
+
If you're using Ruby's standard library Logger, you can use a dynamic formatter:
137
+
138
+
```ruby
139
+
require"logger"
140
+
require"sdk-reforge"
141
+
142
+
client =Reforge::Client.new(
143
+
sdk_key:ENV['REFORGE_BACKEND_SDK_KEY'],
144
+
logger_key:'log-levels.default'# optional, this is the default
145
+
)
146
+
147
+
logger =Logger.new($stdout)
148
+
logger.level =Logger::DEBUG# Set to most verbose level, Reforge will handle filtering
The formatter will check dynamic log levels from Reforge and only output logs that meet the configured threshold.
153
+
130
154
### Configuration
131
155
132
156
In Reforge Launch, create a `LOG_LEVEL_V2` config with your desired key (default: `log-levels.default`). The config will be evaluated with the following context:
0 commit comments