From 8fda26f475f4d5f69571b41bd21a6e817a96b196 Mon Sep 17 00:00:00 2001 From: Thomas Brosset Date: Mon, 11 Dec 2023 16:00:46 +0100 Subject: [PATCH] fix env for development rotation every day same systemoutput logger for every env fix rotation dir --- README.md | 6 ++++++ backend/src/main/resources/log4j2-spring.xml | 20 +++++-------------- .../backend/application-dev.properties | 9 ++++----- 3 files changed, 15 insertions(+), 20 deletions(-) diff --git a/README.md b/README.md index 02224cfe76..e14851b798 100644 --- a/README.md +++ b/README.md @@ -46,6 +46,12 @@ Le code source de monitorenv est fortement inspiré de [MonitorFish](https://git Créer un fichier `./infra/.env` à partir de `./infra/.env.template` Modifier éventuellement `./infra/configurations/backend/application-dev.properties` +### Sentry + +SENTRY_DSN est une variable d'environnement utilisée par Sentry pour identifier l'application. Elle est utilisée par le frontend et le backend. Elle est définie dans le fichier `./infra/.env` et injectée dans l'application frontend via le fichier `./public/env.js`. + +Si `SENTRY_DSN` est définie, les logs du backend seront automatiquement envoyés. + ## Frontend `make dev-install` : installation des dépendances du Frontend diff --git a/backend/src/main/resources/log4j2-spring.xml b/backend/src/main/resources/log4j2-spring.xml index 7155e1981b..7a725813c3 100644 --- a/backend/src/main/resources/log4j2-spring.xml +++ b/backend/src/main/resources/log4j2-spring.xml @@ -1,20 +1,10 @@ - - ${env:SPRING_PROFILES_ACTIVE:-integration} ${env:SENTRY_DSN:-none} - - - - - - - + @@ -22,19 +12,19 @@ + filePattern="${env:BACKEND_LOG_FOLDER:-/home/monitorenv}/logs/${date:yyyy-MM}/kibana-%d{yyyy-MM-dd}-%i.log.gz"> - + - + @@ -49,7 +39,7 @@ - + diff --git a/infra/configurations/backend/application-dev.properties b/infra/configurations/backend/application-dev.properties index 3b35cc744b..6493f79da4 100644 --- a/infra/configurations/backend/application-dev.properties +++ b/infra/configurations/backend/application-dev.properties @@ -3,19 +3,18 @@ monitorenv.server.root=http://localhost:8880 monitorenv.server.port=8880 monitorenv.flyway.locations=classpath:/db/migration,classpath:/db/testdata -# spring.flyway.group=true -# spring.flyway.out-of-order=true - monitorenv.ajp.port=8000 host.ip=localhost:8880 monitorenv.sentry.enabled=false +monitorenv.sentry.environment=dev + ################### # Database settings -#spring.jpa.show-sql=true +# spring.jpa.show-sql=true # spring.jpa.properties.hibernate.format_sql=true -#logging.level.org.hibernate.orm.jdbc.bind=trace +# logging.level.org.hibernate.orm.jdbc.bind=trace # Database used by the application (problem with upper case) env.db.url=jdbc:postgresql://localhost:5432/monitorenvdb?user=postgres&password=postgres