[FEAT] update logger to well support the backend
This commit is contained in:
parent
3898a6bf4f
commit
653e77160b
17
README.md
17
README.md
@ -40,6 +40,23 @@ cd front
|
|||||||
pnpm run unlink_kar_cw
|
pnpm run unlink_kar_cw
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Tools in production mode
|
||||||
|
========================
|
||||||
|
|
||||||
|
Changing the Log Level
|
||||||
|
----------------------
|
||||||
|
|
||||||
|
In a production environment, you can adjust the log level to help diagnose bugs more effectively.
|
||||||
|
|
||||||
|
The available log levels are:
|
||||||
|
| **Log Level Tag** | **org.kar.karusic** | **org.kar.archidata** | **other** |
|
||||||
|
| ----------------- | ------------------- | --------------------- | --------- |
|
||||||
|
| `prod` | INFO | INFO | INFO |
|
||||||
|
| `prod-debug` | DEBUG | INFO | INFO |
|
||||||
|
| `prod-trace` | TRACE | DEBUG | INFO |
|
||||||
|
| `prod-trace-full` | TRACE | TRACE | INFO |
|
||||||
|
| `dev` | TRACE | DEBUG | INFO |
|
||||||
|
|
||||||
|
|
||||||
Manual set in production:
|
Manual set in production:
|
||||||
=========================
|
=========================
|
||||||
|
@ -20,7 +20,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>kangaroo-and-rabbit</groupId>
|
<groupId>kangaroo-and-rabbit</groupId>
|
||||||
<artifactId>archidata</artifactId>
|
<artifactId>archidata</artifactId>
|
||||||
<version>0.20.4</version>
|
<version>0.20.5-SNAPSHOT</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<!-- Loopback of logger JDK logging API to SLF4J -->
|
<!-- Loopback of logger JDK logging API to SLF4J -->
|
||||||
<dependency>
|
<dependency>
|
||||||
@ -39,6 +39,11 @@
|
|||||||
<artifactId>xercesImpl</artifactId>
|
<artifactId>xercesImpl</artifactId>
|
||||||
<version>2.12.2</version>
|
<version>2.12.2</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.codehaus.janino</groupId>
|
||||||
|
<artifactId>janino</artifactId>
|
||||||
|
<version>3.1.9</version>
|
||||||
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.fasterxml.jackson.datatype</groupId>
|
<groupId>com.fasterxml.jackson.datatype</groupId>
|
||||||
<artifactId>jackson-datatype-jsr310</artifactId>
|
<artifactId>jackson-datatype-jsr310</artifactId>
|
||||||
|
@ -1,18 +1,50 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<configuration>
|
<configuration>
|
||||||
<appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
|
<!-- environment detection (defaut: dev) -->
|
||||||
<encoder>
|
<property name="LOG_LEVEL_ENV" value="${LOG_LEVEL:-dev}" />
|
||||||
<pattern>
|
<!-- Appender for development -->
|
||||||
%d{HH:mm:ss.SSS} [%thread] %highlight(%-5level) %logger - %msg%n
|
<if condition="property("LOG_LEVEL_ENV").equals("dev")">
|
||||||
</pattern>
|
<then>
|
||||||
<!--
|
<appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
|
||||||
<pattern>
|
<encoder>
|
||||||
%d{HH:mm:ss.SSS} | %thread | %highlight(%-5level) | %logger - %msg%n
|
<pattern>%green(%d{HH:mm:ss.SSS}) %highlight(%-5level) %-30((%file:%line\)): %msg%n</pattern>
|
||||||
</pattern>
|
</encoder>
|
||||||
-->
|
</appender>
|
||||||
</encoder>
|
<logger name="org.kar.karusic" level="TRACE" />
|
||||||
</appender>
|
<logger name="org.kar.archidata" level="DEBUG" />
|
||||||
|
<root level="INFO">
|
||||||
<root level="info">
|
<appender-ref ref="CONSOLE" />
|
||||||
<appender-ref ref="CONSOLE" />
|
</root>
|
||||||
</root>
|
</then>
|
||||||
</configuration>
|
</if>
|
||||||
|
<!-- Appender for production -->
|
||||||
|
<if condition="property("LOG_LEVEL_ENV").matches("^prod.*")">
|
||||||
|
<then>
|
||||||
|
<appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
|
||||||
|
<encoder>
|
||||||
|
<pattern>[%thread] %level %logger - %msg%n</pattern>
|
||||||
|
</encoder>
|
||||||
|
</appender>
|
||||||
|
<root level="INFO">
|
||||||
|
<appender-ref ref="CONSOLE" />
|
||||||
|
</root>
|
||||||
|
</then>
|
||||||
|
</if>
|
||||||
|
<if condition="property("LOG_LEVEL_ENV").equals("prod-debug")">
|
||||||
|
<then>
|
||||||
|
<logger name="org.kar.karusic" level="DEBUG" />
|
||||||
|
</then>
|
||||||
|
</if>
|
||||||
|
<if condition="property("LOG_LEVEL_ENV").equals("prod-trace")">
|
||||||
|
<then>
|
||||||
|
<logger name="org.kar.karusic" level="TRACE" />
|
||||||
|
<logger name="org.kar.archidata" level="DEBUG" />
|
||||||
|
</then>
|
||||||
|
</if>
|
||||||
|
<if condition="property("LOG_LEVEL_ENV").equals("prod-trace-full")">
|
||||||
|
<then>
|
||||||
|
<logger name="org.kar.karusic" level="TRACE" />
|
||||||
|
<logger name="org.kar.archidata" level="TRACE" />
|
||||||
|
</then>
|
||||||
|
</if>
|
||||||
|
</configuration>
|
Loading…
x
Reference in New Issue
Block a user