Skip to content
Snippets Groups Projects

Better Error Handling and Logging

Merged Timm Fitschen requested to merge dev into main
1 file
+ 1
1
Compare changes
  • Side-by-side
  • Inline
@@ -24,6 +24,30 @@
"$ref": "#/definitions/connection_configuration"
}
},
"logging": {
"type": "object",
"description": "Configuration of logging",
"properties": {
"level": {
"allOf": [
{
"$ref": "#/definitions/log_level_configuration"
},
{
"default": "warn",
"description": "Global severity filter. Only log messages with at least the given severity are processed by the logging framework. 'off' means that the logging frame work is turned off entirely. Defaults to "
}
]
},
"sinks": {
"type": "object",
"description": "Configuration of sinks, i.e. the log files, console or other logging frame works where the log messages are supposed to end up eventually.",
"additionalProperties": {
"$ref": "#/definitions/sink_configuration"
}
}
}
},
"extension": {
"type": "object",
"description": "A reserved configuration object which may be used to store additional options for particular clients and special extensions.",
@@ -31,6 +55,58 @@
}
},
"definitions": {
"log_level_configuration": {
"type": "string",
"enum": ["all", "trace", "debug", "info", "warn", "error", "fatal", "off"]
},
"sink_configuration": {
"type": "object",
"description": "A single sink configuration.",
"additionalProperties": false,
"properties": {
"level": {
"allOf": [
{
"$ref": "#/definitions/log_level_configuration"
},
{
"description": "Sink severity filter. Only log messages with at least the given severity are passed to this sink. 'off' means that this sink is turned off entirely. Defaults to the global log level."
}
]
},
"destination": {
"type": "string",
"enum": [ "console", "file", "syslog"],
"description": "The type of sink-backend. 'console' writes to the STDERR, 'file' to a text file and 'syslog' uses the syslog API."
},
"directory": {
"type": "string",
"description": "Path to local directory. All log files are being stored to this directory. If not specified, the current working directory will be used."
},
"local_address": {
"type": "string",
"description": "Local IP address to initiate connection to the syslog server. If not specified, the default local address will be used."
},
"target_address": {
"type": "string",
"description": "Remote IP address of the syslog server. If not specified, the local address will be used. "
}
},
"required": [ "destination" ],
"allOf": [ {
"if": {"properties": {"destination": { "const": "console" } } },
"then": {"propertyNames" : { "enum": ["level", "destination"] } }
},
{
"if": {"properties": {"destination": { "const": "file" } } },
"then": {"propertyNames" : { "enum": ["level", "destination", "directory"] } }
},
{
"if": {"properties": {"destination": { "const": "syslog" } } },
"then": {"propertyNames" : { "enum": ["level", "destination", "target_address", "local_address"] } }
}
]
},
"connection_configuration": {
"type": "object",
"description": "A single connection configuration.",
Loading