zensols.actioncli.log4j2

Conigure and change the log level of the log4j2 system.

change-log-level

(change-log-level log-name level-thing)(change-log-level level-thing)

Change the Log4j2 log level.

level-thing the log level as either the Level instance or a string.

configure

(configure res)

Congigure the Log4j2 system with res, which can be anything usable with clojure.java.io/input-stream. If res is a string, interpret as a resource.

log-level-set-option

(log-level-set-option)(log-level-set-option short long)

Create an option that sets the Log4j2 level. Note that all you need to do is add this to the option definition and the log level is set in the validate phase.

log-level-set-option-default

Default log level for log-level-set-option.

with-log-level

macro

(with-log-level log-name level-thing & body)

Set the the log level to level-thing (see change-log-level) for the execution of body.

The log-name parameter is one of the following:

  • the string package or namespace name of the logger (usual log name)
  • :ns for the current namespace’s logger