archivist: runtime logs through PocketBase logger (Dashboard > Logs); stderr kept for pre-bootstrap fatals

This commit is contained in:
2026-11-02 11:27:00 +01:00
parent 61586a670a
commit 67c337eb14
8 changed files with 60 additions and 30 deletions
+11
View File
@@ -83,12 +83,23 @@ func main() {
}
app := pocketbase.New()
// The PocketBase logger and database are available only after bootstrap;
// everything logged before this point goes to stderr (arch.md section 9).
if err := app.Bootstrap(); err != nil {
log.Fatalf("pocketbase bootstrap: %v", err)
}
// US-03 / US-04 / US-01: collections migration and superuser account.
if err := pbapp.Setup(app, envCfg.AdminEmail, envCfg.AdminPassword, cfg); err != nil {
log.Fatalf("pocketbase setup: %v", err)
}
// US-01: versioning recommendation, via the PocketBase logger
// (visible in the admin dashboard, Dashboard > Logs).
if s3.StartupWarning != "" {
app.Logger().Warn(s3.StartupWarning, "bucket", envCfg.S3Bucket)
}
// US-22 / US-23 / US-04: request hooks on documents and document_events.
pbapp.BindHooks(app, cfg, s3)