Request logging additions (request id, forwarded user) (#618)

* Add request-id logging
* Missing test file
* Add option to log forwarded user information if available via X-Forwarded-Header
* Format
This commit is contained in:
Dan Sosedoff
2022-12-16 12:38:57 -06:00
committed by GitHub
parent e0a748812d
commit afe431c94d
3 changed files with 56 additions and 0 deletions

View File

@@ -23,6 +23,7 @@ type Options struct {
Debug bool `short:"d" long:"debug" description:"Enable debugging mode"`
LogLevel string `long:"log-level" description:"Logging level" default:"info"`
LogFormat string `long:"log-format" description:"Logging output format" default:"text"`
LogForwardedUser bool `long:"log-forwarded-user" description:"Log user information available in X-Forwarded-User/Email headers"`
URL string `long:"url" description:"Database connection string"`
Host string `long:"host" description:"Server hostname or IP" default:"localhost"`
Port int `long:"port" description:"Server port" default:"5432"`