-
Notifications
You must be signed in to change notification settings - Fork 0
/
README
50 lines (35 loc) · 1.55 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# DEPRECATED
This project is deprecated. The preferred way of controlling log levels
dynamically is to use leiningen's `injection` feature. Here's an example
using injections with a "log4c" profile (in profiles.clj):
```
{
:log4c {:dependencies [[log4j/log4j "1.2.17"]
[com.hotelicopter/log4c "3.0.0"]]
:injections [(require 'log4c.core)
(log4c.core/init!)
(log4c.core/configure! :CLJ_LOG_LEVEL)]}
}
```
# lein-log4c
This leingingen plugin allows you to configure log4j log levels
dynamically from the environment *without* requiring any production
dependency on log4j in your code. This approach is ideally suited for
library developers who don't want to impose a logging solution on
their library's clients.
Log levels are configured by namespace.
## Usage
First, include the plugin in your project or user profile:
{:plugins [[com.roomkey/lein-log4c "1.5.0"]]}
Then simply specify the desired log levels with the CLJ_LOG_LEVEL environment
variable or JVM system property. For example:
CLJ_LOG_LEVEL=:warn,mylib.myns:debug lein test
The above will set the root logger to have a log level of WARN and the
mylib.myns namespace logger to have a level of DEBUG during the
execution of lein test task.
It's possible to override the specific version of log4j or log4c used by specifying the
desired version in the "log4c" profile:
{:log4c {:dependencies [[log4j/log4j "1.2.17"]]}}
## License
Copyright (C) 2016 Roomkey
Distributed under the Eclipse Public License, the same as Clojure.