cache: DNS resolver cache configuration.
dnssec: DNSSEC disabling/enabling and configuration.
dns64: DNS64 disabling/enabling and configuration.
- logging: Logging configuration.
+ logging: Logging and debugging configuration.
lua: Custom Lua configuration.
"""
from typing_extensions import Literal, TypeAlias
+from knot_resolver_manager.datamodel.types import TimeUnit
from knot_resolver_manager.utils import SchemaNode
LogLevelEnum = Literal["crit", "err", "warning", "notice", "info", "debug"]
]
+class DebuggingSchema(SchemaNode):
+ assertion_abort: bool = False
+ assertion_fork: TimeUnit = TimeUnit("5m")
+
+
class LoggingSchema(SchemaNode):
+ """
+ Logging and debugging configuration.
+
+ ---
+ level: Logging level for all processes.
+ target: Logging stream target for all processes.
+ group: List of groups for which 'debug' logging level is set.
+ debugging: Advanced debugging parameters for Knot Resolver daemon (kresd).
+ """
+
level: LogLevelEnum = "notice"
target: Optional[LogTargetEnum] = None
groups: Optional[List[LogGroupsEnum]] = None
+ debugging: DebuggingSchema = DebuggingSchema()
-- logging.level
log_level('{{ cfg.logging.level }}')
-{% if cfg.logging.target %}
+{% if cfg.logging.target -%}
-- logging.target
log_target('{{ cfg.logging.target }}')
-{% endif %}
+{%- endif %}
{% if cfg.logging.groups %}
-- logging.groups
{% endif %}
{% endfor %}
})
-{% endif %}
\ No newline at end of file
+{% endif %}
+
+-- logging.debugging.assertion-abort
+debugging.assertion_abort = {{ 'true' if cfg.logging.debugging.assertion_abort else 'false' }}
+
+-- logging.debugging.assertion-fork
+debugging.assertion_fork = {{ cfg.logging.debugging.assertion_fork.millis() }}
+