Skip to content

Commit 048477f

Browse files
Brutus5000claude
andcommitted
Default JSON log format to logstash for Grafana Loki
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
1 parent 74e73d1 commit 048477f

3 files changed

Lines changed: 3 additions & 3 deletions

File tree

‎configuration.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
| LEAGUE_DATABASE_USERNAME | `faf-league-service` | | `faf-league-service` |
4343
| LOG_FILE_DIRECTORY | | | |
4444
| LOG_LEVEL | `info` | | |
45-
| LOG_STRUCTURED_FORMAT | `ecs` | | Console log format (`ecs`, `logstash`, `gelf`); JSON in the `prod` profile (default), plain text in all other profiles |
45+
| LOG_STRUCTURED_FORMAT | `logstash` | | Console log format (`ecs`, `logstash`, `gelf`); JSON in the `prod` profile (default), plain text in all other profiles |
4646
| MAIL_HOST | `false` | | |
4747
| MAIL_PASSWORD | `false` | | |
4848
| MAIL_PORT | `false` | | |

‎src/main/resources/config/application.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ logging:
183183
structured:
184184
format:
185185
# JSON logs by default (prod/test); the local profile switches back to plain text
186-
console: ${LOG_STRUCTURED_FORMAT:ecs}
186+
console: ${LOG_STRUCTURED_FORMAT:logstash}
187187
pattern:
188188
console: "%clr(%d{yyyy-MM-dd HH:mm:ss.SSS}){faint} %clr(%5p) %clr(${PID:- }){magenta} %clr(---){faint} %clr([%36.36X{requestId:- no request context}]){faint} %clr([%15.15t]){faint} %clr(%-40.40logger{39}){cyan} %clr(:){faint} %m%n%wEx"
189189
level:

‎src/main/resources/logback-spring.xml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<configuration>
22
<include resource="org/springframework/boot/logging/logback/defaults.xml"/>
33
<property name="LOG_FILE" value="${LOG_FILE:-${LOG_PATH:-${LOG_TEMP:-${java.io.tmpdir:-/tmp}}}/spring.log}"/>
4-
<springProperty scope="context" name="CONSOLE_LOG_STRUCTURED_FORMAT" source="logging.structured.format.console" defaultValue="ecs"/>
4+
<springProperty scope="context" name="CONSOLE_LOG_STRUCTURED_FORMAT" source="logging.structured.format.console" defaultValue="logstash"/>
55

66
<!-- JSON on the console for prod (default profile); plain text for every other profile -->
77
<springProfile name="prod">

0 commit comments

Comments
 (0)