Skip to content

Commit

Permalink
Use profiles to avoid sending local logs to Loki
Browse files Browse the repository at this point in the history
  • Loading branch information
joffrey-bion committed Feb 14, 2021
1 parent c7d9a33 commit a8a2dc9
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 6 deletions.
3 changes: 3 additions & 0 deletions kubernetes/server.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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>

0 comments on commit a8a2dc9

Please sign in to comment.