-
Notifications
You must be signed in to change notification settings - Fork 0
logging
User65k edited this page Oct 6, 2021
·
3 revisions
Logging defaults to log on STDERR (if not started by systemd):
-
flash_rust_ws::configWarn (Configuration parsing) -
flash_rust_ws::dispatchWarn (Request resolving) -
flash_rust_wsWarn (This server) -
hyperWarn (Low level HTTP server) -
async_fcgiWarn (FastCGI) -
flash_rust_ws::transport::tlsWarn (TLS) -
rustlsWarn (Low level TLS) -
async_acmeWarn (ACME)
The variable RUST_LOG can be used to change flash_rust_ws, hyperand async_fcgi to one of the values:
debuginfotrace
These settings will be overridden by settings present in the config file (once the config file is parsed).
There are preconfigured appenders that can be used without defining them:
-
stderrlogs to STDERR with pattern{d(%Y-%m-%d %H:%M:%S %Z)(utc)} {h({l})} {t} - {m}{n} -
stdoutlogs to STDOUT with pattern{d(%Y-%m-%d %H:%M:%S %Z)(utc)} {h({l})} {t} - {m}{n} -
journal(only UNIX) log to journald
- Log all requests to
./requests.log(Level info forflash_rust_ws::dispatch) - Log everything else as usual
# Log warnings+ to STDERR (default)
log.appenders.stderr = {kind = "console", target="stderr", encoder={pattern = "{d} {l} {t} - {m}{n}"}}
log.root = {level = "warn", appenders = ["stderr"]}
# Log info+ of class "flash_rust_ws::dispatch" to "./requests.log"
log.appenders.requests = {kind = "file", path = "./requests.log", append=true, encoder={pattern = "{d} {m}{n}"}}
log.loggers."flash_rust_ws::dispatch" = {level = "info",appenders = ["requests"],additive = false}or
# Log warnings+ to STDERR (default)
[log.appenders.stderr] # create an appender named "stderr"
kind = "console" # ... that logs to the console
target = "stderr" # ... on stderr (not out)
encoder = {pattern = "{d} {l} {t} - {m}{n}"}
[log.root]
level = "warn"
appenders = ["stderr"] # use the appender from above
# Log info+ of class "flash_rust_ws::dispatch" to "./requests.log"
[log.appenders.requests] # create an appender named "requests"
kind = "file" # ... that logs to a file
path = "./requests.log"
append = true # do not overwrite the file
encoder = {pattern = "{d} {m}{n}"}
[log.loggers."flash_rust_ws::dispatch"] # create an addtional logger for the class "flash_rust_ws::dispatch"
level = "info"
appenders = ["requests"]
additive = false # do NOT also use the root logger- Home
- systemd
-
Server Config
- logging
-
virtual host
- TLS
-
mount path
- authentication
- type: FCGI
- type: Redirect
- type: Reverse Proxy
- type: static files
- type: webdav
- type: websocket