Structured logging integration with Sentry.
Provides logging functions at all standard levels:
trace
, debug
, info
, warn
, error
, fatal
- Level-specific logging functionslog
- Generic logging function accepting level as parameter, supports structured logging with maps(info "User logged in: %s" username)
(error "Database error: %s" (.getMessage ex))
(log :warn "Service unavailable")
(log :error "Failed operation: %s" operation-name)
(log :fatal
{:user-id "123" :operation "payment" :critical true}
"Critical system failure")
Structured logging integration with Sentry. Provides logging functions at all standard levels: - `trace`, `debug`, `info`, `warn`, `error`, `fatal` - Level-specific logging functions - `log` - Generic logging function accepting level as parameter, supports structured logging with maps ## Basic Usage ```clojure (info "User logged in: %s" username) (error "Database error: %s" (.getMessage ex)) ``` ## Generic Logging ```clojure (log :warn "Service unavailable") (log :error "Failed operation: %s" operation-name) ``` ## Structured Logging ```clojure (log :fatal {:user-id "123" :operation "payment" :critical true} "Critical system failure") ```
(log level & args)
Generic logging function that accepts log level and optional parameters.
(log :error "Something went wrong")
(log :info "User %s logged in from %s" username ip-address)
(log :fatal
{:user-id "123"
:operation "checkout"
:critical true
:amount 99.99}
"Payment processing failed for user %s"
user-id)
(log :warn
(SentryInstantDate.)
"Delayed processing detected at %s"
(System/currentTimeMillis))
level
- Log level keyword (:trace
, :debug
, :info
, :warn
, :error
, :fatal
) or SentryLogLevel enumargs
- Message and optional parameters: either [message & format-args]
or [date-or-params message & format-args]
Generic logging function that accepts log level and optional parameters. ## Usage Examples ### Basic logging with level keyword: ```clojure (log :error "Something went wrong") (log :info "User %s logged in from %s" username ip-address) ``` ### Structured logging with attributes: ```clojure (log :fatal {:user-id "123" :operation "checkout" :critical true :amount 99.99} "Payment processing failed for user %s" user-id) ``` ### Logging with custom timestamp: ```clojure (log :warn (SentryInstantDate.) "Delayed processing detected at %s" (System/currentTimeMillis)) ``` ## Parameters - `level` - Log level keyword (`:trace`, `:debug`, `:info`, `:warn`, `:error`, `:fatal`) or SentryLogLevel enum - `args` - Message and optional parameters: either `[message & format-args]` or `[date-or-params message & format-args]`
cljdoc builds & hosts documentation for Clojure/Script libraries
Ctrl+k | Jump to recent docs |
← | Move to previous article |
→ | Move to next article |
Ctrl+/ | Jump to the search field |