add: SQLite-backed structured logging with retention
Replace JSON/file logging with a logs.db (WAL) store. Thread the logger through the encoder and metadata client for debug instrumentation of every ffmpeg/ffprobe/opusenc invocation and OMDb/TVmaze request. API keys are redacted before request URLs are logged. Retention defaults to 7 days, overridable via log_retention_days in config.
This commit is contained in:
+4
-15
@@ -1,9 +1,5 @@
|
||||
package types
|
||||
|
||||
import (
|
||||
"time"
|
||||
)
|
||||
|
||||
type MediaType string
|
||||
|
||||
const (
|
||||
@@ -36,9 +32,10 @@ type Metadata struct {
|
||||
}
|
||||
|
||||
type Config struct {
|
||||
OMDBAPIKey string `yaml:"omdb_api_key"`
|
||||
Encoding EncodingConfig
|
||||
Paths PathsConfig
|
||||
OMDBAPIKey string `yaml:"omdb_api_key"`
|
||||
LogRetentionDays int `yaml:"log_retention_days"`
|
||||
Encoding EncodingConfig
|
||||
Paths PathsConfig
|
||||
}
|
||||
|
||||
type EncodingConfig struct {
|
||||
@@ -60,11 +57,3 @@ type PathsConfig struct {
|
||||
Failed string `yaml:"failed"`
|
||||
Work string `yaml:"work"`
|
||||
}
|
||||
|
||||
type LogEntry struct {
|
||||
Timestamp time.Time `json:"timestamp"`
|
||||
Level string `json:"level"`
|
||||
Message string `json:"message"`
|
||||
File string `json:"file,omitempty"`
|
||||
Error string `json:"error,omitempty"`
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user