Liking cljdoc? Tell your friends :D

logjam.repl

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)
raw docstring

*frameworks*clj

source

*settings*clj

source

add-appenderclj

(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.
sourceraw docstring

add-consumerclj

(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.
sourceraw docstring

appenderclj

(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.
sourceraw docstring

appendersclj

(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.
sourceraw docstring

clear-appenderclj

(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.
sourceraw docstring

eventclj

(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.
sourceraw docstring

eventsclj

(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.
sourceraw docstring

frameworkclj

(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.
sourceraw docstring

logclj

(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.
sourceraw docstring

remove-appenderclj

(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.
sourceraw docstring

remove-consumerclj

(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.
sourceraw docstring

set-appender!clj

(set-appender! identifier)

Change the current appender to identifier.

Change the current appender to `identifier`.
sourceraw docstring

set-consumer!clj

(set-consumer! identifier)

Change the current consumer to identifier.

Change the current consumer to `identifier`.
sourceraw docstring

set-framework!clj

(set-framework! identifier)

Change the current framework to identifier.

Change the current framework to `identifier`.
sourceraw docstring

shutdownclj

(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.
sourceraw docstring

update-appenderclj

(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.
sourceraw docstring

update-consumerclj

(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.
sourceraw docstring

update-settings!clj

(update-settings! f & args)

Update the *settings* by applying f and args to it.

Update the `*settings*` by applying `f` and `args` to it.
sourceraw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close