diff options
Diffstat (limited to 'cmd/gotosocial/common.go')
| -rw-r--r-- | cmd/gotosocial/common.go | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/cmd/gotosocial/common.go b/cmd/gotosocial/common.go index bfa5b656d..4aa468ebf 100644 --- a/cmd/gotosocial/common.go +++ b/cmd/gotosocial/common.go @@ -64,11 +64,17 @@ func preRun(a preRunArgs) error { // context, after initializing any last-minute things like loggers etc. func run(ctx context.Context, action action.GTSAction) error { log.SetTimeFormat(config.GetLogTimestampFormat()) - // Set the global log level from configuration + + // Set the global log level from configuration. if err := log.ParseLevel(config.GetLogLevel()); err != nil { return fmt.Errorf("error parsing log level: %w", err) } + // Set global log output format from configuration. + if err := log.ParseFormat(config.GetLogFormat()); err != nil { + return fmt.Errorf("error parsing log format: %w", err) + } + if config.GetSyslogEnabled() { // Enable logging to syslog if err := log.EnableSyslog( |
