summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--kubernetes/server.yml3
-rw-r--r--sw-server/src/main/resources/logback-spring.xml (renamed from sw-server/src/main/resources/logback.xml)21
2 files changed, 18 insertions, 6 deletions
diff --git a/kubernetes/server.yml b/kubernetes/server.yml
index 3838bdfb..e9ef25ff 100644
--- a/kubernetes/server.yml
+++ b/kubernetes/server.yml
@@ -16,6 +16,9 @@ spec:
containers:
- name: seven-wonders-server
env:
+ # Profile "prod" is used in particular to enable sending logs to Loki
+ - name: SPRING_PROFILES_ACTIVE
+ value: prod
- name: LOKI_USERNAME
valueFrom:
secretKeyRef:
diff --git a/sw-server/src/main/resources/logback.xml b/sw-server/src/main/resources/logback-spring.xml
index 766c0a5c..07b9e58e 100644
--- a/sw-server/src/main/resources/logback.xml
+++ b/sw-server/src/main/resources/logback-spring.xml
@@ -28,11 +28,20 @@
</format>
</appender>
- <root level="DEBUG">
- <appender-ref ref="CONSOLE"/>
- </root>
- <root level="INFO">
- <appender-ref ref="LOKI"/>
- </root>
+ <springProfile name="prod">
+ <root level="INFO">
+ <appender-ref ref="CONSOLE"/>
+ <appender-ref ref="LOKI"/>
+ </root>
+ </springProfile>
+
+ <springProfile name="!prod">
+ <root level="DEBUG">
+ <appender-ref ref="CONSOLE"/>
+ </root>
+ <logger name="org.springframework" level="INFO" additivity="false">
+ <appender-ref ref="CONSOLE" />
+ </logger>
+ </springProfile>
</configuration>
bgstack15