diff --git a/src/config.go b/src/config.go index 688ae1f..9bd050b 100644 --- a/src/config.go +++ b/src/config.go @@ -12,7 +12,8 @@ type CacheConfig struct { } type Config struct { - Listen struct { + LogFormat string `toml:"log-format"` + Listen struct { Pages string `toml:"pages"` Caddy string `toml:"caddy"` Health string `toml:"health"` diff --git a/src/main.go b/src/main.go index ccdb8f3..6f9f7ec 100644 --- a/src/main.go +++ b/src/main.go @@ -41,6 +41,13 @@ func main() { } UpdateConfigEnv() // environment takes priority + switch config.LogFormat { + case "short": + log.SetFlags(0) + default: + log.SetFlags(log.Ldate | log.Ltime | log.LUTC) + } + switch config.Backend.Type { case "fs": if backend, err = NewFSBackend(config.Backend.FS.Root); err != nil {