diff --git a/README.md b/README.md index a06a5dd..f5cdc33 100644 --- a/README.md +++ b/README.md @@ -216,7 +216,8 @@ examples of the appropriate syntax. * `AccessLog`: Path to access log file (default value `access.log`, i.e. in the current wrorking directory). Note that all intermediate directories must exist, Molly Brown won't create them for you. Set - to `-` for logging to `stdout`. + to `-` for logging to `stdout`, or to an empty string to disable + access logging. * `ErrorLog`: Path to error log file. If set to an empty string (the default), Molly Brown will log errors to stderr (where they are easily captured by systemd or similar init systems). If set to a diff --git a/main.go b/main.go index 6725f14..03aaa36 100644 --- a/main.go +++ b/main.go @@ -52,6 +52,10 @@ func main() { errorLog := log.New(errorLogFile, "", log.Ldate | log.Ltime) var accessLogFile *os.File + // TODO: Find a more elegant/portable way to disable logging + if config.AccessLog == "" { + config.AccessLog = "/dev/null" + } if config.AccessLog == "-" { accessLogFile = os.Stdout } else {