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
(sentry-log/log:warn (SentryInstantDate.) "Delayed processing detected at %s" (System/currentTimeMillis))
226
+
```
227
+
228
+
### Log levels
229
+
230
+
Level-specific logging functions that provide a convenient way to log messages at specific levels. Each function accepts a message string and optional format arguments.
231
+
232
+
- `trace` - Log at trace level
233
+
- `debug` - Log at debug level
234
+
- `info` - Log at info level
235
+
- `warn` - Log at warning level
236
+
- `error` - Log at error level
237
+
- `fatal` - Log at fatal level
238
+
239
+
All level-specific functions accept the same parameters as `(info message arg1 arg2)`:
240
+
- `message` - A `String` containing the log message, optionally with format placeholders
241
+
- `& args` - Optional format arguments for message interpolation
242
+
243
+
### Generic log
244
+
245
+
The `log` function provides flexible logging with support for structured attributes and custom timestamps. It accepts a log level keyword followed by various argument combinations.
246
+
247
+
**Parameters:**
248
+
- `level` - A `keyword` specifying the log level (`:trace`, `:debug`, `:info`, `:warn`, `:error`, `:fatal`)
249
+
- `data` - Optional `map` of attributes or `SentryDate`, to add structured data to the log entry
250
+
- `message` - A `String` containing the log message, optionally with format placeholders
251
+
- `& args` - Optional format arguments for message interpolation
If you are using Logback, you can add the Sentry appender to your logback configuration and include the `io.sentry/sentry-logback {:mvn/version"RELEASE"}` library in your `deps.edn`.
258
+
259
+
**Two configuration approaches:**
260
+
261
+
1. **With `sentry/init!` in your application**: If you initialize Sentry in your app using `sentry/init!`, you don't need to specify a DSN in the logback configuration.
<!-- Optionally change minimum Log level. Default for Log Events is INFO -->
275
+
<minimumLevel>INFO</minimumLevel>
276
+
</appender>
277
+
...
278
+
</configuration>
279
+
```
280
+
281
+
2. **Standalone logback configuration**: If you don't start Sentry in your app at all, you can add `<dsn>${SENTRY_DSN}</dsn>` and logs configuration to the Sentry appender options. Logs will be sent to Sentry automatically, and error logs will become error events.
0 commit comments