added more detailed debug logging
This commit is contained in:
+55
-2
@@ -41,6 +41,7 @@ Current version: **v0.2.1**
|
||||
- Pre-deploy memory validation (hard block on `mem_request` overcommit, soft warning on `mem_limit` overcommit)
|
||||
- Memory summary bar shown on deploy page before deployment
|
||||
- Felhom.eu logo SVG in sidebar and login page
|
||||
- Verbose debug logging with operation timing, post-start container state checks, and image pull detection
|
||||
|
||||
### Known issues / next priorities
|
||||
- Cloudflare Tunnel + Traefik TLS: paperless.demo-felhom.eu works locally but shows "Not secure" (certificate chain not fully validated through tunnel)
|
||||
@@ -89,9 +90,11 @@ controller/
|
||||
├── internal/
|
||||
│ ├── config/config.go # YAML loader, validation, env overrides
|
||||
│ ├── stacks/
|
||||
│ │ ├── manager.go # Stack scanning, compose ops, container status
|
||||
│ │ ├── manager.go # Stack scanning, compose ops, container status, debug logging
|
||||
│ │ ├── metadata.go # Parse .felhom.yml app metadata
|
||||
│ │ └── deploy.go # First-deploy flow: secret gen, app.yaml, compose up
|
||||
│ ├── sync/
|
||||
│ │ └── sync.go # Git sync: clone/pull app catalog, content-hash copy
|
||||
│ ├── api/router.go # REST API endpoints
|
||||
│ ├── system/
|
||||
│ │ ├── info.go # SystemInfo struct
|
||||
@@ -121,6 +124,7 @@ controller/
|
||||
| **API** | `internal/api/` | ✅ Done | REST endpoints (stacks, deploy, rescan, system info, health) |
|
||||
| **System** | `internal/system/` | ✅ Done | System resource info (RAM, disk usage) for dashboard & API |
|
||||
| **Web** | `internal/web/` | ✅ Done | Hungarian dashboard, auth, deploy pages, asset serving |
|
||||
| **Sync** | `internal/sync/` | ✅ Done | Git-based app catalog sync (clone/pull, content-hash copy) |
|
||||
| **Backup** | `internal/backup/` | 📲 Phase 3 | DB dumps, restic snapshots, restore |
|
||||
| **Monitor** | `internal/monitor/` | 📲 Phase 2 | Health checks, Healthchecks pings, system metrics |
|
||||
| **Scheduler** | `internal/scheduler/` | 📲 Phase 2 | Cron-like job runner for all periodic tasks |
|
||||
@@ -208,6 +212,53 @@ The following stacks cannot be stopped from the customer UI:
|
||||
- `cloudflared` (tunnel)
|
||||
- `felhom-controller` (this container)
|
||||
|
||||
## Logging
|
||||
|
||||
The controller uses two-tier logging controlled by `logging.level` in `controller.yaml`:
|
||||
|
||||
```yaml
|
||||
logging:
|
||||
level: debug # debug | info | warn | error (default: info)
|
||||
file: "" # optional log file path
|
||||
max_size_mb: 10
|
||||
max_files: 3
|
||||
```
|
||||
|
||||
Can also be set via environment variable: `FELHOM_LOGGING_LEVEL=debug`
|
||||
|
||||
### What gets logged at each level
|
||||
|
||||
| Level | What's logged |
|
||||
|-------|--------------|
|
||||
| **info** | Operation success/failure with elapsed time, post-start container states, stack scan counts, deploy memory checks |
|
||||
| **debug** | All of above + env var keys per compose command, local image availability checks, compose command timing, log fetch byte counts |
|
||||
|
||||
### Example output (debug level)
|
||||
|
||||
```
|
||||
[INFO] Starting stack: immich
|
||||
[DEBUG] Env vars for compose: [DOMAIN, DB_PASSWORD, HDD_PATH] (3 app + 42 system)
|
||||
[DEBUG] Running: docker compose up -d (in /opt/docker/stacks/immich)
|
||||
[DEBUG] Command completed: docker compose up -d (took 12.3s)
|
||||
[INFO] Stack immich started successfully (took 12.3s)
|
||||
[INFO] Stack immich post-start status:
|
||||
[INFO] immich-server ghcr.io/immich-app/immich-server:release running Up 3 seconds (health: starting)
|
||||
[INFO] immich-postgres docker.io/tensorchord/pgvecto-rs:pg16... running Up 3 seconds (healthy)
|
||||
[INFO] immich-redis docker.io/library/redis:7-alpine running Up 3 seconds (healthy)
|
||||
```
|
||||
|
||||
On failure:
|
||||
```
|
||||
[ERROR] Command failed: docker compose up -d (in /opt/docker/stacks/immich) — exit code 1 (took 2.1s)
|
||||
[ERROR] stderr: Error response from daemon: pull access denied...
|
||||
[ERROR] Stack immich start failed after 2.1s: exit code 1
|
||||
```
|
||||
|
||||
### Security
|
||||
|
||||
- Env var **values** are never logged — only keys appear in debug output
|
||||
- stdout/stderr in error logs are truncated to 500 characters to prevent log spam
|
||||
|
||||
## Configuration
|
||||
|
||||
### Controller config (infrastructure only)
|
||||
@@ -356,7 +407,9 @@ docker compose up -d
|
||||
- [ ] Restore workflow
|
||||
|
||||
### Phase 4 — Git Sync & Updates
|
||||
- [ ] Periodic git pull for stack definitions
|
||||
- [x] Periodic git pull for stack definitions (git sync module)
|
||||
- [x] Manual sync button on Alkalmazások page ("Sablonok frissítése")
|
||||
- [x] Sync status in `/api/system/info`
|
||||
- [ ] Update classification (optional/required/security)
|
||||
- [ ] Update window enforcement
|
||||
- [ ] Dashboard update notifications with "Update" button
|
||||
|
||||
Reference in New Issue
Block a user