* [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>
@ -44,19 +44,20 @@ func fieldtag(field, tag string) string {
// will need to regenerate the global Getter/Setter helpers by running:
// `go run ./internal/config/gen/ -out ./internal/config/helpers.gen.go`
typeConfigurationstruct{
LogLevelstring`name:"log-level" usage:"Log level to run at: [trace, debug, info, warn, fatal]"`
LogDbQueriesbool`name:"log-db-queries" usage:"Log database queries verbosely when log-level is trace or debug"`
LogClientIPbool`name:"log-client-ip" usage:"Include the client IP in logs"`
ApplicationNamestring`name:"application-name" usage:"Name of the application, used in various places internally"`
LandingPageUserstring`name:"landing-page-user" usage:"the user that should be shown on the instance's landing page"`
ConfigPathstring`name:"config-path" usage:"Path to a file containing gotosocial configuration. Values set in this file will be overwritten by values set as env vars or arguments"`
Hoststring`name:"host" usage:"Hostname to use for the server (eg., example.org, gotosocial.whatever.com). DO NOT change this on a server that's already run!"`
AccountDomainstring`name:"account-domain" usage:"Domain to use in account names (eg., example.org, whatever.com). If not set, will default to the setting for host. DO NOT change this on a server that's already run!"`
Protocolstring`name:"protocol" usage:"Protocol to use for the REST api of the server (only use http if you are debugging or behind a reverse proxy!)"`
BindAddressstring`name:"bind-address" usage:"Bind address to use for the GoToSocial server (eg., 0.0.0.0, 172.138.0.9, [::], localhost). For ipv6, enclose the address in square brackets, eg [2001:db8::fed1]. Default binds to all interfaces."`
Portint`name:"port" usage:"Port to use for GoToSocial. Change this to 443 if you're running the binary directly on the host machine."`
TrustedProxies[]string`name:"trusted-proxies" usage:"Proxies to trust when parsing x-forwarded headers into real IPs."`
LogLevelstring`name:"log-level" usage:"Log level to run at: [trace, debug, info, warn, fatal]"`
LogTimestampFormatstring`name:"log-timestamp-format" usage:"Format to use for the log timestamp, as supported by Go's time.Layout"`
LogDbQueriesbool`name:"log-db-queries" usage:"Log database queries verbosely when log-level is trace or debug"`
LogClientIPbool`name:"log-client-ip" usage:"Include the client IP in logs"`
ApplicationNamestring`name:"application-name" usage:"Name of the application, used in various places internally"`
LandingPageUserstring`name:"landing-page-user" usage:"the user that should be shown on the instance's landing page"`
ConfigPathstring`name:"config-path" usage:"Path to a file containing gotosocial configuration. Values set in this file will be overwritten by values set as env vars or arguments"`
Hoststring`name:"host" usage:"Hostname to use for the server (eg., example.org, gotosocial.whatever.com). DO NOT change this on a server that's already run!"`
AccountDomainstring`name:"account-domain" usage:"Domain to use in account names (eg., example.org, whatever.com). If not set, will default to the setting for host. DO NOT change this on a server that's already run!"`
Protocolstring`name:"protocol" usage:"Protocol to use for the REST api of the server (only use http if you are debugging or behind a reverse proxy!)"`
BindAddressstring`name:"bind-address" usage:"Bind address to use for the GoToSocial server (eg., 0.0.0.0, 172.138.0.9, [::], localhost). For ipv6, enclose the address in square brackets, eg [2001:db8::fed1]. Default binds to all interfaces."`
Portint`name:"port" usage:"Port to use for GoToSocial. Change this to 443 if you're running the binary directly on the host machine."`
TrustedProxies[]string`name:"trusted-proxies" usage:"Proxies to trust when parsing x-forwarded headers into real IPs."`