diff options
author | 2023-08-21 20:07:55 +0200 | |
---|---|---|
committer | 2023-08-21 19:07:55 +0100 | |
commit | 4ae16bce8c6aa8e3d96ca69015d2065badee3994 (patch) | |
tree | ebced804b50c4905e133d606b6416e0fce7b9f72 /internal/config/defaults.go | |
parent | [performance] Tweak media attachment cleanup; replace stale index (#2143) (diff) | |
download | gotosocial-4ae16bce8c6aa8e3d96ca69015d2065badee3994.tar.xz |
[feature] Make log format configurable (#2130)
* [feature] Don't emit timestamp in log lines
When running gotosocial with a service manager like systemd, or a
container runtime, the associated log driver usually emits timestamps
itself. In those cases, having the extra timestamp from our own log
lines ends up being a bit noisy and when centrally ingesting logs is
duplicate information.
This introduces a configuration flag that allows disabling emitting the
timestamp. It's only wired up for "daemonised" processes, meaning server
and testrig.
* [chore] Add docs for log-timestamp
* [feature] Simplify timestamp handling
Co-Authored-By: kim <89579420+NyaaaWhatsUpDoc@users.noreply.github.com>
* [chore] Less escaped double-quotes
* [chore] Fix help string
---------
Co-authored-by: kim <89579420+NyaaaWhatsUpDoc@users.noreply.github.com>
Diffstat (limited to 'internal/config/defaults.go')
-rw-r--r-- | internal/config/defaults.go | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/internal/config/defaults.go b/internal/config/defaults.go index 61a037157..3703d8372 100644 --- a/internal/config/defaults.go +++ b/internal/config/defaults.go @@ -27,17 +27,18 @@ import ( // Defaults contains a populated Configuration with reasonable defaults. Note that // if you use this, you will still need to set Host, and, if desired, ConfigPath. var Defaults = Configuration{ - LogLevel: "info", - LogDbQueries: false, - ApplicationName: "gotosocial", - LandingPageUser: "", - ConfigPath: "", - Host: "", - AccountDomain: "", - Protocol: "https", - BindAddress: "0.0.0.0", - Port: 8080, - TrustedProxies: []string{"127.0.0.1/32", "::1"}, // localhost + LogLevel: "info", + LogTimestampFormat: "02/01/2006 15:04:05.000", + LogDbQueries: false, + ApplicationName: "gotosocial", + LandingPageUser: "", + ConfigPath: "", + Host: "", + AccountDomain: "", + Protocol: "https", + BindAddress: "0.0.0.0", + Port: 8080, + TrustedProxies: []string{"127.0.0.1/32", "::1"}, // localhost DbType: "postgres", DbAddress: "", |