Add structured production logging (#105, #107) (#141)

* Update README.md

* Add structured JSON production logging (#105)

* Log requests and background failures (#107)

* Document production logging and the VPS runbook
This commit is contained in:
2026-11-10 22:00:05 +01:00
committed by GitHub
parent f8897fa5ae
commit 202b9b1f6a
20 changed files with 1380 additions and 15 deletions
+7 -1
View File
@@ -5,8 +5,13 @@ defmodule Chesstrainer.Cache.Persist do
A backup is written to a temporary DETS file in the same directory and then
atomically renamed into place. A crash during the write therefore leaves the
previous backup untouched instead of a truncated file that fails to restore.
A backup that cannot be opened at boot is logged and skipped, so a damaged
file does not stop the application from starting with an empty cache.
"""
require Logger
@backup_path "priv/static/backups"
@format_version "v2"
@@ -54,7 +59,8 @@ defmodule Chesstrainer.Cache.Persist do
:dets.close(table)
{:error, _} ->
{:error, reason} ->
Logger.warning("cache backup restore failed", table: table, reason: reason)
:ok
end
end