diff --git a/AGENTS.md b/AGENTS.md index 3781382..5675522 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -15,6 +15,7 @@ - Global API error shape comes from `server/src/main/java/br/com/tasknoteapp/server/controller/RestExceptionController.java`; frontend expects `message` or `fields[].fieldMessage` (`client/src/api-service/api.ts`). - Email and password-reset flows are Resend-backed (`server/src/main/java/br/com/tasknoteapp/server/service/ResendEmailService.java`) and render HTML bodies from templates under `server/src/main/resources/email-templates/` via `server/src/main/java/br/com/tasknoteapp/server/templates/EmailTemplate.java`. - Backend targets **Java 25** and **Spring Boot 4.x** (`server/pom.xml`). +- Backend log format is env-driven: plain console by default, ECS JSON when `LOGGING_STRUCTURED_FORMAT_CONSOLE=ecs` (set in `terraform/main.tf` and `compose.prod-like.yaml`; leave unset locally). Log level stays controlled by `ROOT_LOG_LEVEL`. ## Developer workflows (use these first) - Frontend quality gate: `bash tools/check-frontend.sh` (runs `npm ci`, `lint:fix`, `build`, `test:no-watch`). diff --git a/compose.prod-like.yaml b/compose.prod-like.yaml index 1a71382..3de3a68 100644 --- a/compose.prod-like.yaml +++ b/compose.prod-like.yaml @@ -25,6 +25,7 @@ services: TARGET_ENV: production SECURITY_KEY: this-is-a-very-long-security-key-for-dev RESEND_APIKEY: invalid-api-key-only-placeholder + LOGGING_STRUCTURED_FORMAT_CONSOLE: ecs ports: ["8585:8585"] image: ghcr.io/thermcampos/tasknote/server:latest healthcheck: diff --git a/server/src/main/resources/application.yml b/server/src/main/resources/application.yml index c0e9af6..04bfedd 100644 --- a/server/src/main/resources/application.yml +++ b/server/src/main/resources/application.yml @@ -11,6 +11,9 @@ logging: level: root: ${ROOT_LOG_LEVEL:INFO} br.com.tasknoteapp: INFO + structured: + format: + console: ${LOGGING_STRUCTURED_FORMAT_CONSOLE:} resend: api-key: ${RESEND_APIKEY:abc123456} diff --git a/terraform/main.tf b/terraform/main.tf index bf51ea8..592ddd8 100644 --- a/terraform/main.tf +++ b/terraform/main.tf @@ -255,6 +255,10 @@ resource "kubernetes_deployment_v1" "tasknote_backend" { name = "ROOT_LOG_LEVEL" value = var.root_log_level } + env { + name = "LOGGING_STRUCTURED_FORMAT_CONSOLE" + value = "ecs" + } env { name = "SECURITY_KEY" value_from {