aboutsummaryrefslogtreecommitdiff
path: root/src/main/resources
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2022-12-08 10:16:56 +0300
committerGravatar Vitaly Takmazov2022-12-08 10:16:56 +0300
commitcfc787394a506459c71b4a124149e5d6de7690a8 (patch)
tree7353b2ea3f368148e2b5dadea996c775a6f54ac0 /src/main/resources
parente79c930f089ed7c0a916d23fa07b27c8415af49c (diff)
Conditional logging configuration
Diffstat (limited to 'src/main/resources')
-rw-r--r--src/main/resources/logback-spring.xml94
1 files changed, 51 insertions, 43 deletions
diff --git a/src/main/resources/logback-spring.xml b/src/main/resources/logback-spring.xml
index 5e2fd704..7dc247c4 100644
--- a/src/main/resources/logback-spring.xml
+++ b/src/main/resources/logback-spring.xml
@@ -1,49 +1,57 @@
<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE configuration>
<configuration>
- <include resource="org/springframework/boot/logging/logback/defaults.xml"/>
- <property name="LOG_FILE" value="${LOG_FILE:-${LOG_PATH:-${LOG_TEMP:-${java.io.tmpdir:-/tmp}}/}server.log}"/>
+ <include resource="org/springframework/boot/logging/logback/defaults.xml" />
+ <property name="LOG_FILE" value="${LOG_FILE:-${LOG_PATH:-${LOG_TEMP:-${java.io.tmpdir:-/tmp}}/}server.log}" />
<include resource="org/springframework/boot/logging/logback/file-appender.xml" />
+ <include resource="org/springframework/boot/logging/logback/console-appender.xml" />
<root level="INFO">
- <appender-ref ref="FILE" />
+ <appender-ref ref="CONSOLE" />
</root>
- <appender name="XMPP" class="ch.qos.logback.core.FileAppender">
- <file>${LOG_PATH}/xmpp.log</file>
- <append>true</append>
- <encoder>
- <pattern>%d{yyyy-MM-dd HH:mm:ss} %logger{36} - %msg%n</pattern>
- </encoder>
- </appender>
- <appender name="Session" class="ch.qos.logback.core.FileAppender">
- <file>${LOG_PATH}/session.log</file>
- <append>true</append>
- <encoder>
- <pattern>%d{yyyy-MM-dd HH:mm:ss} %logger{36} - %msg%n</pattern>
- </encoder>
- </appender>
- <appender name="Telegram" class="ch.qos.logback.core.FileAppender">
- <file>${LOG_PATH}/durov.log</file>
- <append>true</append>
- <encoder>
- <pattern>%d{yyyy-MM-dd HH:mm:ss} %logger{36} - %msg%n</pattern>
- </encoder>
- </appender>
- <appender name="ActivityPub" class="ch.qos.logback.core.FileAppender">
- <file>${LOG_PATH}/activity.log</file>
- <append>true</append>
- <encoder>
- <pattern>%d{yyyy-MM-dd HH:mm:ss} %logger{36} - %msg%n</pattern>
- </encoder>
- </appender>
- <logger name="XMPP" level="DEBUG" additivity="false">
- <appender-ref ref="XMPP" />
- </logger>
- <logger name="Session" level="DEBUG" additivity="false">
- <appender-ref ref="Session" />
- </logger>
- <logger name="Telegram" level="DEBUG" additivity="false">
- <appender-ref ref="Telegram" />
- </logger>
- <logger name="ActivityPub" level="DEBUG" additivity="false">
- <appender-ref ref="ActivityPub" />
- </logger>
+ <springProfile name="production">
+ <root level="INFO">
+ <appender-ref ref="CONSOLE" />
+ <appender-ref ref="FILE" />
+ </root>
+ <appender name="XMPP" class="ch.qos.logback.core.FileAppender">
+ <file>${LOG_PATH}/xmpp.log</file>
+ <append>true</append>
+ <encoder>
+ <pattern>%d{yyyy-MM-dd HH:mm:ss} %logger{36} - %msg%n</pattern>
+ </encoder>
+ </appender>
+ <appender name="Session" class="ch.qos.logback.core.FileAppender">
+ <file>${LOG_PATH}/session.log</file>
+ <append>true</append>
+ <encoder>
+ <pattern>%d{yyyy-MM-dd HH:mm:ss} %logger{36} - %msg%n</pattern>
+ </encoder>
+ </appender>
+ <appender name="Telegram" class="ch.qos.logback.core.FileAppender">
+ <file>${LOG_PATH}/durov.log</file>
+ <append>true</append>
+ <encoder>
+ <pattern>%d{yyyy-MM-dd HH:mm:ss} %logger{36} - %msg%n</pattern>
+ </encoder>
+ </appender>
+ <appender name="ActivityPub" class="ch.qos.logback.core.FileAppender">
+ <file>${LOG_PATH}/activity.log</file>
+ <append>true</append>
+ <encoder>
+ <pattern>%d{yyyy-MM-dd HH:mm:ss} %logger{36} - %msg%n</pattern>
+ </encoder>
+ </appender>
+ <logger name="XMPP" level="DEBUG" additivity="false">
+ <appender-ref ref="XMPP" />
+ </logger>
+ <logger name="Session" level="DEBUG" additivity="false">
+ <appender-ref ref="Session" />
+ </logger>
+ <logger name="Telegram" level="DEBUG" additivity="false">
+ <appender-ref ref="Telegram" />
+ </logger>
+ <logger name="ActivityPub" level="DEBUG" additivity="false">
+ <appender-ref ref="ActivityPub" />
+ </logger>
+ </springProfile>
</configuration>