docs: Document new logging settings

Signed-off-by: Steffen Vogel <post@steffenvogel.de>
This commit is contained in:
Steffen Vogel
2023-08-11 12:26:53 +02:00
parent 483375d002
commit c4d0181867
4 changed files with 53 additions and 1 deletions

View File

@@ -181,6 +181,9 @@ func setupLogging(cfg *config.Config) error {
if cfg != nil {
rules = append(rules, cfg.Log.Rules...)
if cfg.Log.Level != "" {
rules = append(rules, cfg.Log.Level)
}
}
if len(rules) == 0 {

View File

@@ -27,6 +27,54 @@ rpc:
wait: false
# Logging configuration
log:
# Show a banner during start of daemon
banner: true
# Use one of
# - auto only colorize log output on TTYs
# - never never colorize log output
# - always always colorize log output
color: auto
# A path to a custom log file
file: mylogfile.log
# The standard log level
level: info
# Additional logging rules
# Rule syntax:
#
# RULE: LEVELS:NAMESPACES
#
# LEVELS: LEVEL[,LEVELS]
# LEVEL: one of
# - SEVERITY for matching all levels with equal or higher severity
# - >SEVERITY for matching all levels with higher severity
# - =SEVERITY for matching all levels with equal severity
# - <SEVERITY for matching all levels with lower severity
#
# SEVERITY: one of
# - debug10..debug1
# - debug
# - info
# - warn
# - error
# - fatal
# - panic
#
# NAMESPACES: NAMESPACE[,NAMESPACES]
# NAMESPACE: one of
# - namespace should be exactly this namespace
# - *mat*ch* should match
# - -NAMESPACE should not match a namespace
rules:
- debug5:watcher,daemon
- debug6:epdisc.*
#### Interface settings start here
# The following settings can be overwritten for each interface
# using the 'interfaces' settings (see below).

View File

@@ -75,6 +75,7 @@ func (s *ICESettings) HasNetworkType(nt ice.NetworkType) bool {
}
type LogSettings struct {
Level string `koanf:"level,omitempty"`
Rules []string `koanf:"rules,omitempty"`
File string `koanf:"file,omitempty"`
Color string `koanf:"color,omitempty"`

View File

@@ -193,7 +193,7 @@ func ParseRules(rules []string) (FilterFunc, error) {
// - LEVELS
// LEVELS: LEVEL[,LEVELS]
// LEVEL: see `Level Patterns`
// NAMESPACES: NAMESPACE[,NAMESPACE]
// NAMESPACES: NAMESPACE[,NAMESPACES]
// NAMESPACE: one of:
// - namespace // Should be exactly this namespace
// - *mat*ch* // Should match