feat(platform)!: log exclusively as structured json

Request access logs, panics, migration output and fatal errors are now
emitted through the JSON slog handler.

BREAKING CHANGE: UPTIME_LOG_FORMAT is removed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017GpWAskjmYtZpuQ5JwYTX3
This commit is contained in:
Sebastian UnterschützandClaude Opus 5.5 committed 2026-11-21 23:41:57 +01:00
1 parent 8d1093cd2d
commit e9c7394c8b
8 files changed
+108 -48

No files matched your search

+7 -6
View File
@@ -1,7 +1,7 @@
package main
import (
"fmt"
"log/slog"
"os"
"time"
@@ -11,21 +11,22 @@ import (
)
func main() {
if err := run(); err != nil {
fmt.Fprintln(os.Stderr, err)
log := platform.NewLogger("statuspage")
if err := run(log); err != nil {
log.Error("exit", "error", err)
os.Exit(1)
}
}
func run() error {
func run(log *slog.Logger) error {
cfg, err := config.Load[config.StatusPage]()
if err != nil {
return err
}
platform.SetLogLevel(cfg.LogLevel)
ctx, stop := platform.SignalContext()
defer stop()
log := platform.NewLogger(cfg.Common, "statuspage")
deps, err := platform.Connect(ctx, cfg.Common, log)
if err != nil {
return err
@@ -33,7 +34,7 @@ func run() error {
defer deps.Close()
health := platform.NewHealth(deps.Probes())
r := platform.NewRouter()
r := platform.NewRouter(log)
health.Register(r)
r.StaticFS("/static", web.Static())