Skip to content

Commit

Permalink
Final commit for this branch
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel Villavicencio authored and Daniel Villavicencio committed May 21, 2024
1 parent 34830c4 commit aa52e6c
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 49 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ build/
!**/src/test/**/build/
\\
\\.pub
compose.yml

### STS ###
.apt_generated
Expand Down
15 changes: 10 additions & 5 deletions compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,16 +48,14 @@ services:
grafana:
container_name: grafana
environment:
- GF_PATHS_PROVISIONING=/etc/grafana/provisioning
- GF_AUTH_ANONYMOUS_ENABLED=true
- GF_AUTH_ANONYMOUS_ORG_ROLE=Admin
GF_SECURITY_ADMIN_USER__FILE: /run/secrets/grafana_admin_username
GF_SECURITY_ADMIN_PASSWORD__FILE: /run/secrets/grafana_admin_password
entrypoint:
- sh
- -euc
- |
mkdir -p /etc/grafana/provisioning/datasources
cat <<EOF > /etc/grafana/provisioning/datasources/ds.yaml
apiVersion: 1
datasources:
- name: Loki
type: loki
Expand All @@ -73,6 +71,9 @@ services:
image: grafana/grafana-oss:latest
ports:
- "3000:3000"
secrets:
- "grafana_admin_username"
- "grafana_admin_password"

secrets:
mongo_username:
Expand All @@ -94,4 +95,8 @@ secrets:
bungie_client_id:
environment: "BUNGIE_CLIENT_ID"
bungie_client_secret:
environment: "BUNGIE_CLIENT_SECRET"
environment: "BUNGIE_CLIENT_SECRET"
grafana_admin_username:
environment: "GRAFANA_ADMIN_USERNAME"
grafana_admin_password:
environment: "GRAFANA_ADMIN_PASSWORD"
79 changes: 36 additions & 43 deletions src/main/resources/logback-spring.xml
Original file line number Diff line number Diff line change
@@ -1,49 +1,42 @@
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<!-- local configuration -->
<springProfile name="local">
<configuration>
<appender name="LOKI" class="com.github.loki4j.logback.Loki4jAppender">
<http>
<url>http://localhost:3100/loki/api/v1/push</url>
</http>
<format>
<label>
<pattern>level=%level</pattern>
<readMarkers>true</readMarkers>
</label>
<message>
<pattern>%-5level [%.5(${HOSTNAME})] %.10thread %logger{20} | %msg %ex</pattern>
</message>
</format>
</appender>

<root level="INFO">
<appender-ref ref="LOKI"/>
</root>
</configuration>
<!-- prod configuration -->
<!-- Local configuration -->
<springProfile name="local">
<appender name="LOKI" class="com.github.loki4j.logback.Loki4jAppender">
<http>
<url>http://localhost:3100/loki/api/v1/push</url>
</http>
<format>
<label>
<pattern>level=%level</pattern>
<readMarkers>true</readMarkers>
</label>
<message>
<pattern>%-5level [%.5(${HOSTNAME})] %.10thread %logger{20} | %msg %ex</pattern>
</message>
</format>
</appender>
</springProfile>
<springProfile name="prod">
<configuration>
<appender name="LOKI" class="com.github.loki4j.logback.Loki4jAppender">
<http>
<url>http://loki:3100/loki/api/v1/push</url>
</http>
<format>
<label>
<pattern>level=%level</pattern>
<readMarkers>true</readMarkers>
</label>
<message>
<pattern>%-5level [%.5(${HOSTNAME})] %.10thread %logger{20} | %msg %ex</pattern>
</message>
</format>
</appender>

<root level="INFO">
<appender-ref ref="LOKI"/>
</root>
</configuration>
<!-- Production configuration -->
<springProfile name="prod">
<appender name="LOKI" class="com.github.loki4j.logback.Loki4jAppender">
<http>
<url>http://loki:3100/loki/api/v1/push</url>
</http>
<format>
<label>
<pattern>level=%level</pattern>
<readMarkers>true</readMarkers>
</label>
<message>
<pattern>%-5level [%.5(${HOSTNAME})] %.10thread %logger{20} | %msg %ex</pattern>
</message>
</format>
</appender>
<root level="INFO">
<appender-ref ref="LOKI"/>
</root>
</springProfile>
</configuration>
</configuration>

0 comments on commit aa52e6c

Please sign in to comment.