diff --git a/.env.example b/.env.example index a859bf8b..49230c82 100644 --- a/.env.example +++ b/.env.example @@ -46,10 +46,11 @@ ALLOW_REGISTRATION=true # RATE_LIMIT=60 # SECURE_COOKIES=true # Handler-level logs come from the `http_axum` crate; startup/wiring logs come -# from `server`. Include both — `server=info` alone silently drops handler logs. +# from `bootstrap`; config-load logs come from `config`. Include all three — +# `server=info` alone silently drops them. # Crates not named here (adapters, etc.) still log warnings and errors unless # you set a bare level yourself (e.g. `info,http_axum=debug`). -# RUST_LOG=server=info,http_axum=info,tower_http=info,worker=info +# RUST_LOG=server=info,worker=info,bootstrap=info,config=info,http_axum=info,tower_http=info # CORS (for SPA development only) # CORS_ORIGINS=http://localhost:5173 diff --git a/CODE_STYLE.md b/CODE_STYLE.md index b0f021d2..73dea40b 100644 --- a/CODE_STYLE.md +++ b/CODE_STYLE.md @@ -47,7 +47,7 @@ Small files with a single concern. If a file grows past ~100-150 lines, it's pro ### Tests -Never in the same file as production code. Each crate keeps its tests in `crates//tests/`, one file per unit under test, grouped by the same module as the production code. Cargo builds each top-level `tests/.rs` as one integration-test binary; the group file lists its members with `#[path]`: +Tests live outside production files, apart from the few exceptions listed below. Each crate keeps its tests in `crates//tests/`, one file per unit under test, grouped by the same module as the production code. Cargo builds each top-level `tests/.rs` as one integration-test binary; the group file lists its members with `#[path]`: ``` crates/application/src/diary/log_review.rs diff --git a/Dockerfile b/Dockerfile index 1b8d79b2..e5401a81 100644 --- a/Dockerfile +++ b/Dockerfile @@ -87,6 +87,6 @@ COPY --from=spa-builder /spa/dist ./spa/dist EXPOSE 3000 -ENV RUST_LOG=server=info,tower_http=info +ENV RUST_LOG=server=info,worker=info,bootstrap=info,config=info,http_axum=info,tower_http=info CMD ["./server"] diff --git a/README.md b/README.md index 6df55ec0..14a75adc 100644 --- a/README.md +++ b/README.md @@ -151,13 +151,13 @@ Copy `.env.example` to `.env` and set the values you need. Malformed values (a n | `MINIO_ACCESS_KEY_ID` | — | S3 only | Access key ID | | `MINIO_SECRET_ACCESS_KEY` | — | S3 only | Secret access key | | `IMAGE_CONVERSION_ENABLED` | `false` | No | Set `true` to convert stored images to AVIF or WebP (only the value `true` enables it) | -| `IMAGE_CONVERSION_FORMAT` | — | When conversion is enabled | `avif` or `webp`; startup fails if conversion is enabled without it | +| `IMAGE_CONVERSION_FORMAT` | — | When conversion is enabled | `avif` or `webp`; the worker fails at startup if conversion is enabled without it | | `HOST` | `0.0.0.0` | No | Bind address | | `PORT` | `3000` | No | HTTP port | | `RATE_LIMIT` | `60` | No | Requests per minute per IP | | `ALLOW_REGISTRATION` | `false` | No | Set `true` (or `1`) to allow new sign-ups | | `SECURE_COOKIES` | `false` | No | Set `true` when serving over HTTPS (only the value `true` enables it) | -| `RUST_LOG` | — | No | Log verbosity (e.g. `server=info,worker=info`); read by the logger, not part of `config.toml` | +| `RUST_LOG` | — | No | Log verbosity (e.g. `server=info,worker=info,bootstrap=info,config=info,http_axum=info`); read by the logger, not part of `config.toml` | | `CORS_ORIGINS` | empty | No | Comma-separated allowed origins for the API; empty or `*` allows any origin | | `EVENT_BUS_BACKEND` | `db` | No | `db` (default) or `nats` | | `NATS_URL` | — | NATS only | NATS connection URL (e.g. `nats://localhost:4222`) | diff --git a/crates/server/src/main.rs b/crates/server/src/main.rs index 2b111c26..b5593b59 100644 --- a/crates/server/src/main.rs +++ b/crates/server/src/main.rs @@ -4,7 +4,7 @@ use tokio::net::TcpListener; #[tokio::main] async fn main() -> anyhow::Result<()> { dotenvy::dotenv().ok(); - bootstrap::init_tracing("server=debug,bootstrap=debug,tower_http=debug"); + bootstrap::init_tracing("server=debug,bootstrap=debug,config=info,tower_http=debug"); let config = config::load().context("Failed to load configuration")?; let app = bootstrap::build_server(&config).await?; diff --git a/crates/worker/src/main.rs b/crates/worker/src/main.rs index 05c679fa..592476b4 100644 --- a/crates/worker/src/main.rs +++ b/crates/worker/src/main.rs @@ -3,7 +3,7 @@ use anyhow::Context; #[tokio::main] async fn main() -> anyhow::Result<()> { dotenvy::dotenv().ok(); - bootstrap::init_tracing("worker=info,bootstrap=info,application=info,k_ap=info"); + bootstrap::init_tracing("worker=info,bootstrap=info,config=info,application=info,k_ap=info"); let config = config::load().context("Failed to load configuration")?; let app = bootstrap::build_worker(&config).await?;