diff --git a/configuration.md b/configuration.md index 10b4da809..29f9d7211 100644 --- a/configuration.md +++ b/configuration.md @@ -42,6 +42,7 @@ | LEAGUE_DATABASE_USERNAME | `faf-league-service` | | `faf-league-service` | | LOG_FILE_DIRECTORY | | | | | LOG_LEVEL | `info` | | | +| LOG_STRUCTURED_FORMAT | `logstash` | | Console log format (`ecs`, `logstash`, `gelf`); JSON by default, plain text in the `local` profile | | MAIL_HOST | `false` | | | | MAIL_PASSWORD | `false` | | | | MAIL_PORT | `false` | | | diff --git a/src/main/resources/config/application-local.yml b/src/main/resources/config/application-local.yml index 7f81df781..8815db1eb 100644 --- a/src/main/resources/config/application-local.yml +++ b/src/main/resources/config/application-local.yml @@ -90,5 +90,8 @@ spring: jwk-set-uri: http://hydra.faforever.localhost/.well-known/jwks.json issuer-uri: http://ory-hydra:4444/ logging: + structured: + format: + console: "" level: com.faforever.api: debug diff --git a/src/main/resources/config/application.yml b/src/main/resources/config/application.yml index 1084a55af..23f715ae6 100644 --- a/src/main/resources/config/application.yml +++ b/src/main/resources/config/application.yml @@ -180,6 +180,10 @@ management: exposure: include: '*' logging: + structured: + format: + # JSON logs by default (prod/test); the local profile switches back to plain text + console: ${LOG_STRUCTURED_FORMAT:logstash} pattern: 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" level: diff --git a/src/main/resources/logback.xml b/src/main/resources/logback.xml deleted file mode 100644 index 207ecc281..000000000 --- a/src/main/resources/logback.xml +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - ${LOG_PATH:-${LOG_TEMP:-${java.io.tmpdir:-/tmp}}}/audit.log - - audit.%d{yyyy-MM-dd}.log - - - - %d - %msg%n - - - - - - -