forked from quarkusio/quarkus
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes quarkusio#1847
- Loading branch information
Showing
5 changed files
with
90 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
core/runtime/src/main/java/io/quarkus/runtime/logging/FormatType.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package io.quarkus.runtime.logging; | ||
|
||
/** | ||
* The type of formatter to use. | ||
*/ | ||
public enum FormatType { | ||
/** | ||
* Format in text for person-readability. | ||
*/ | ||
TEXT, | ||
/** | ||
* Format in JSON for machine-readability. | ||
*/ | ||
JSON, | ||
; | ||
|
||
public static FormatType of(String str) { | ||
if (str.equalsIgnoreCase("text")) { | ||
return TEXT; | ||
} else if (str.equalsIgnoreCase("json")) { | ||
return JSON; | ||
} else { | ||
throw new IllegalArgumentException("Unrecognized value: " + str); | ||
} | ||
} | ||
} |
16 changes: 16 additions & 0 deletions
16
core/runtime/src/main/java/io/quarkus/runtime/logging/JsonConfig.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package io.quarkus.runtime.logging; | ||
|
||
import io.quarkus.runtime.annotations.ConfigGroup; | ||
import io.quarkus.runtime.annotations.ConfigItem; | ||
|
||
/** | ||
* JSON-specific logging configuration. | ||
*/ | ||
@ConfigGroup | ||
public class JsonConfig { | ||
/** | ||
* Enable logging of call details (method name, class name, etc.) into the JSON output. | ||
*/ | ||
@ConfigItem | ||
public boolean callDetails; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters