1
1
# avaje-simple-logger
2
2
3
- A SLF4J Logger built primarily for use with GraalVM Native image that writes JSON structured logs to ` System.out ` .
4
- It is designed to be used by applications that will be run in ** K8s** or ** Lambda** .
3
+ A SLF4J Logger built primarily for use with GraalVM Native image that writes JSON structured logs to ` System.out ` .
4
+ It is designed to be used by applications that will be run in ** K8s** or ** Lambda** .
5
5
6
6
7
7
## Background
8
8
9
- This logger has been created from the Logback JSON Encoder from [ avaje-logback-encoder] ( https://github.com/avaje/avaje-logback-encoder ) ,
9
+ This logger has been created from the Logback JSON Encoder from [ avaje-logback-encoder] ( https://github.com/avaje/avaje-logback-encoder ) ,
10
10
and turned into a SLF4J Logger, thus removing the dependency on Logback and its associated XML configuration.
11
11
12
12
@@ -18,7 +18,7 @@ and turned into a SLF4J Logger, thus removing the dependency on Logback and its
18
18
<dependency >
19
19
<groupId >io.avaje</groupId >
20
20
<artifactId >avaje-simple-logger</artifactId >
21
- <version >0.1 </version >
21
+ <version >0.2 </version >
22
22
</dependency >
23
23
```
24
24
@@ -36,14 +36,14 @@ log.level.io.avaje=INFO
36
36
37
37
#### Step 3: ` src/test/resources/avaje-logger-test.properties `
38
38
39
- For testing, we might desire to log in a plain format rather than JSON format.
39
+ For testing, we might desire to log in a plain format rather than JSON format.
40
40
We also might want to define some test specific log levels.
41
41
42
42
Add test specific configuration via ` src/test/resources/avaje-logger-test.properties `
43
43
44
44
``` properties
45
45
# # for testing we desire plain format than json format
46
- logger.writer =plain
46
+ logger.format =plain
47
47
48
48
# # default log level to use when running tests
49
49
logger.defaultLogLevel =INFO
@@ -57,7 +57,7 @@ log.level.io.ebean.DDL=TRACE
57
57
58
58
## Configure
59
59
60
- Configure the logger via main resource ` avaje-logger.properties `
60
+ Configure the logger via main resource ` avaje-logger.properties `
61
61
and test resource ` avaje-logger-test.properties `
62
62
63
63
@@ -66,8 +66,8 @@ and test resource `avaje-logger-test.properties`
66
66
logger.defaultLogLevel =warn
67
67
68
68
# # specify to log as `json` or `plain` format (defaults to json)
69
- logger.writer =json
70
- logger.writer =plain
69
+ # logger.format =json
70
+ logger.format =plain
71
71
72
72
# # specify if the logger name is abbreviated. Values:
73
73
# # - full - use the full logger name
@@ -95,7 +95,7 @@ logger.timestampPattern=ISO_OFFSET_DATE_TIME
95
95
avaje-simple-logger automatically registers with avaje-config such that any configuration changes that
96
96
start with ` log.level. ` are logging level configuration changes, and these are applied.
97
97
98
- avaje-config supports plugins like [ AWS AppConfig] ( https://avaje.io/config/#aws-appconfig ) , where
98
+ avaje-config supports plugins like [ AWS AppConfig] ( https://avaje.io/config/#aws-appconfig ) , where
99
99
configuration changes can be dynamically made to the application. For example, ` log.level. ` changes
100
100
can be dynamically made this way.
101
101
@@ -109,7 +109,7 @@ This excludes the avaje-config dependency.
109
109
<dependency >
110
110
<groupId >io.avaje</groupId >
111
111
<artifactId >avaje-simple-json-logger</artifactId >
112
- <version >0.1 </version >
112
+ <version >0.2 </version >
113
113
</dependency >
114
114
```
115
115
@@ -122,4 +122,4 @@ nameLevels.put("com.foo.bar", "info");
122
122
...
123
123
LoggerContext . get(). putAll(nameLevels);
124
124
```
125
-
125
+
0 commit comments