dyndnsd: allow enabling debug logging

This commit is contained in:
cn 2020-07-20 12:04:22 +02:00
parent 0c4c38cc6b
commit 8976ff5bbe
3 changed files with 14 additions and 5 deletions

View File

@ -1,5 +1,11 @@
# Changelog # Changelog
## 2.3.0
IMPROVEMENTS:
- Allow enabling debug logging
## 2.2.0 (March 6, 2020) ## 2.2.0 (March 6, 2020)
IMPROVEMENTS: IMPROVEMENTS:

View File

@ -25,7 +25,7 @@ Create a configuration file in YAML format somewhere:
```yaml ```yaml
# listen address and port # listen address and port
host: "0.0.0.0" host: "0.0.0.0"
port: "80" port: 80
# optional: drop privileges in case you want to but you may need sudo for external commands # optional: drop privileges in case you want to but you may need sudo for external commands
user: "nobody" user: "nobody"
group: "nogroup" group: "nogroup"
@ -33,6 +33,8 @@ group: "nogroup"
logfile: "dyndnsd.log" logfile: "dyndnsd.log"
# internal database file # internal database file
db: "db.json" db: "db.json"
# enable debug mode?
debug: false
# all hostnames are required to be cool-name.example.org # all hostnames are required to be cool-name.example.org
domain: "example.org" domain: "example.org"
# configure the updater, here we use command_with_bind_zone, params are updater-specific # configure the updater, here we use command_with_bind_zone, params are updater-specific
@ -68,7 +70,7 @@ A feature NSD is lacking is the [Dynamic DNS update](https://tools.ietf.org/html
```yaml ```yaml
host: "0.0.0.0" host: "0.0.0.0"
port: "8245" # the DynDNS.com alternative HTTP port port: 8245 # the DynDNS.com alternative HTTP port
db: "/opt/dyndnsd/db.json" db: "/opt/dyndnsd/db.json"
domain: "dyn.example.org" domain: "dyn.example.org"
updater: updater:
@ -88,7 +90,7 @@ users:
foo: foo:
password: "secret" password: "secret"
hosts: hosts:
- foo.example.org - foo.example.org
``` ```
Start dyndnsd.rb before NSD to make sure the zone file exists else NSD complains. Start dyndnsd.rb before NSD to make sure the zone file exists else NSD complains.
@ -139,7 +141,7 @@ For monitoring dyndnsd.rb uses the [metriks](https://github.com/eric/metriks) fr
```yaml ```yaml
host: "0.0.0.0" host: "0.0.0.0"
port: "8245" # the DynDNS.com alternative HTTP port port: 8245 # the DynDNS.com alternative HTTP port
db: "/opt/dyndnsd/db.json" db: "/opt/dyndnsd/db.json"
domain: "dyn.example.org" domain: "dyn.example.org"
# configure the Graphite backend to be used instead of proctitle # configure the Graphite backend to be used instead of proctitle
@ -180,7 +182,7 @@ Currently only one OpenTracing-compatible tracer implementation named [CNCF Jaeg
```yaml ```yaml
host: "0.0.0.0" host: "0.0.0.0"
port: "8245" # the DynDNS.com alternative HTTP port port: 8245 # the DynDNS.com alternative HTTP port
db: "/opt/dyndnsd/db.json" db: "/opt/dyndnsd/db.json"
domain: "dyn.example.org" domain: "dyn.example.org"
# enable and configure tracing using the (currently only) tracer jaeger # enable and configure tracing using the (currently only) tracer jaeger

View File

@ -249,6 +249,7 @@ module Dyndnsd
Dyndnsd.logger.progname = 'dyndnsd' Dyndnsd.logger.progname = 'dyndnsd'
Dyndnsd.logger.formatter = LogFormatter.new Dyndnsd.logger.formatter = LogFormatter.new
Dyndnsd.logger.level = config['debug'] ? Logger::DEBUG : Logger::INFO
end end
# @return [void] # @return [void]