Skip to content

Commit

Permalink
+ using String instead of CharSequence in JSON bean to avoid dsljson …
Browse files Browse the repository at this point in the history
…issue with allowing unknown properties
  • Loading branch information
q3769 committed Apr 16, 2024
1 parent 5f922c1 commit 0e6eea5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 11 deletions.
8 changes: 1 addition & 7 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

<groupId>io.github.elf4j</groupId>
<artifactId>elf4j-engine</artifactId>
<version>15.2.0</version>
<version>15.2.1</version>
<packaging>jar</packaging>
<name>elf4j-engine</name>
<description>A stand-alone Java log engine implementing the ELF4J (Easy Logging Facade for Java) API</description>
Expand Down Expand Up @@ -153,12 +153,6 @@
<annotationProcessor>com.dslplatform.json.processor.CompiledJsonAnnotationProcessor
</annotationProcessor>
</annotationProcessors>
<compilerArguments>
<!-- <Adsljson.loglevel>DEBUG</Adsljson.loglevel>-->
<!-- <Adsljson.annotation>EXPLICIT</Adsljson.annotation>-->
<Adsljson.unknown>ALLOW</Adsljson.unknown>
<!-- <Adsljson.configuration>com.dslplatform.maven.DslJsonConfiguration</Adsljson.configuration>-->
</compilerArguments>
</configuration>
<dependencies>
<dependency>
Expand Down
9 changes: 5 additions & 4 deletions src/main/java/elf4j/engine/service/pattern/JsonElement.java
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,8 @@ static class JsonLogEntry {
String callerClass;
LogEvent.StackFrameValue callerDetail;
Map<String, String> context;
CharSequence message;
CharSequence exception;
String message;
String exception;

static JsonLogEntry from(@NonNull LogEvent logEvent, @NonNull JsonElement jsonPattern) {
return JsonLogEntry.builder()
Expand All @@ -128,12 +128,13 @@ static JsonLogEntry from(@NonNull LogEvent logEvent, @NonNull JsonElement jsonPa
.callerThread(jsonPattern.includeCallerThread ? logEvent.getCallerThread() : null)
.callerDetail(
jsonPattern.includeCallerDetail ? Objects.requireNonNull(logEvent.getCallerFrame()) : null)
.message(logEvent.getResolvedMessage())
.message(logEvent.getResolvedMessage().toString())
.context(MDC.getCopyOfContextMap())
.exception(
logEvent.getThrowable() == null
? null
: StackTraces.getTraceAsBuffer(logEvent.getThrowable()))
: StackTraces.getTraceAsBuffer(logEvent.getThrowable())
.toString())
.build();
}
}
Expand Down

0 comments on commit 0e6eea5

Please sign in to comment.