This namespace provide functionality to capture and search log events emitted by Java logging frameworks. It is designed to be used by non-NREPL users in a plain REPL.
Example usage:
;; Use the :logback logging framework (repl/set-framework! :logback)
;; Add an appender to the log framework that captures events. (repl/add-appender)
;; Log something (repl/log :message "hello")
;; Return all captured log events (repl/events)
;; Search log events by message (repl/events :pattern "hell.*")
;; Search log events by level (repl/events :level :INFO)
;; Add a log consumer that prints log events (repl/add-consumer :callback (fn [_consumer event] (clojure.pprint/pprint event)))
;; Log something else (repl/log :message "world")
;; Remove all consumers and appenders (repl/shutdown)
This namespace provide functionality to capture and search log events emitted by Java logging frameworks. It is designed to be used by non-NREPL users in a plain REPL. Example usage: ;; Use the :logback logging framework (repl/set-framework! :logback) ;; Add an appender to the log framework that captures events. (repl/add-appender) ;; Log something (repl/log :message "hello") ;; Return all captured log events (repl/events) ;; Search log events by message (repl/events :pattern "hell.*") ;; Search log events by level (repl/events :level :INFO) ;; Add a log consumer that prints log events (repl/add-consumer :callback (fn [_consumer event] (clojure.pprint/pprint event))) ;; Log something else (repl/log :message "world") ;; Remove all consumers and appenders (repl/shutdown)
(add-appender & {:as options})
Add a log appender to a framework.
Options: :framework - The identifier of the framework. :appender - The identifier of the appender. :filters - A map of criteria used to filter log events. :logger - The name of the logger to which the append will be attached. :size - The number of events to capture in the appender. :threshold - A threshold in percentage used to garbage collect log events.
Add a log appender to a framework. Options: :framework - The identifier of the framework. :appender - The identifier of the appender. :filters - A map of criteria used to filter log events. :logger - The name of the logger to which the append will be attached. :size - The number of events to capture in the appender. :threshold - A threshold in percentage used to garbage collect log events.
(add-consumer & {:as options})
Add a log consumer to a framework.
Options: :framework - The identifier of the framework. :appender - The identifier of the appender. :consumer - The identifier of the consumer. :callback - A function that will be called for each log event. :filters - A map of criteria used to filter log events.
Add a log consumer to a framework. Options: :framework - The identifier of the framework. :appender - The identifier of the appender. :consumer - The identifier of the consumer. :callback - A function that will be called for each log event. :filters - A map of criteria used to filter log events.
(appender & {:as options})
Return the appender of a log framework.
Options: :framework - The identifier of the framework. :appender - The identifier of the appender.
Return the appender of a log framework. Options: :framework - The identifier of the framework. :appender - The identifier of the appender.
(appenders & {:as options})
Return all appenders of a log framework.
Options: :framework - The identifier of the framework.
Return all appenders of a log framework. Options: :framework - The identifier of the framework.
(clear-appender & {:as options})
Clear the events captured by and appender of a framework.
Options: :framework - The identifier of the framework. :appender - The identifier of the appender.
Clear the events captured by and appender of a framework. Options: :framework - The identifier of the framework. :appender - The identifier of the appender.
(event & {:as options})
Find a log event captured by the an appender of a framework.
Options: :framework - The identifier of the framework. :appender - The identifier of the appender. :event - The identifier of the event.
Find a log event captured by the an appender of a framework. Options: :framework - The identifier of the framework. :appender - The identifier of the appender. :event - The identifier of the event.
(events & {:as options})
Search log events captured by an appender of a framework.
Options: :framework - The identifier of the framework. :appender - The identifier of the appender. :end-time - Only include events before this timestamp. :exceptions - Only include events matching the exception classes. :level - Only include events with the given level. :loggers - Only include events emitted by the loggers. :pattern - Only include events whose message matches the regex pattern. :start-time - Only include events after this timestamp. :threads - Only include events emitted by the given threads.
Search log events captured by an appender of a framework. Options: :framework - The identifier of the framework. :appender - The identifier of the appender. :end-time - Only include events before this timestamp. :exceptions - Only include events matching the exception classes. :level - Only include events with the given level. :loggers - Only include events emitted by the loggers. :pattern - Only include events whose message matches the regex pattern. :start-time - Only include events after this timestamp. :threads - Only include events emitted by the given threads.
(framework & {:as options})
Lookup the current log framework or the one in options
.
Options: :framework - The identifier of the framework.
Lookup the current log framework or the one in `options`. Options: :framework - The identifier of the framework.
(log & {:as options})
Emit a log event.
Options: :framework - The identifier of the framework. :message - The message of the log event. :mdc - The mapped diagnostic context of the log event. :arguments - The arguments of the log event. :level - The level of the log event. :logger - The logger used to emit the log event.
Emit a log event. Options: :framework - The identifier of the framework. :message - The message of the log event. :mdc - The mapped diagnostic context of the log event. :arguments - The arguments of the log event. :level - The level of the log event. :logger - The logger used to emit the log event.
(remove-appender & {:as options})
Remove an appender from a framework.
Options: :framework - The identifier of the framework. :appender - The identifier of the appender.
Remove an appender from a framework. Options: :framework - The identifier of the framework. :appender - The identifier of the appender.
(remove-consumer & {:as options})
Remove a consumer from an appender.
Options: :framework - The identifier of the framework. :appender - The identifier of the appender. :consumer - The identifier of the consumer.
Remove a consumer from an appender. Options: :framework - The identifier of the framework. :appender - The identifier of the appender. :consumer - The identifier of the consumer.
(set-appender! identifier)
Change the current appender to identifier
.
Change the current appender to `identifier`.
(set-consumer! identifier)
Change the current consumer to identifier
.
Change the current consumer to `identifier`.
(set-framework! identifier)
Change the current framework to identifier
.
Change the current framework to `identifier`.
(shutdown & {:as options})
Remove all consumers and appenders of a framework.
Options: :framework - The identifier of the framework.
Remove all consumers and appenders of a framework. Options: :framework - The identifier of the framework.
(update-appender & {:as options})
Update the appender of a framework.
Options: :framework - The identifier of the framework. :appender - The identifier of the appender. :filters - A map of criteria used to filter log events. :logger - The name of the logger to which the append will be attached. :size - The number of events to capture in the appender. :threshold - A threshold in percentage used to garbage collect log events.
Update the appender of a framework. Options: :framework - The identifier of the framework. :appender - The identifier of the appender. :filters - A map of criteria used to filter log events. :logger - The name of the logger to which the append will be attached. :size - The number of events to capture in the appender. :threshold - A threshold in percentage used to garbage collect log events.
(update-consumer & {:as options})
Update the consumer of an appender.
Options: :framework - The identifier of the framework. :appender - The identifier of the appender. :consumer - The identifier of the consumer. :filters - A map of criteria used to filter log events.
Update the consumer of an appender. Options: :framework - The identifier of the framework. :appender - The identifier of the appender. :consumer - The identifier of the consumer. :filters - A map of criteria used to filter log events.
(update-settings! f & args)
Update the *settings*
by applying f
and args
to it.
Update the `*settings*` by applying `f` and `args` to it.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close