v0.1.3-pre.007
This commit is contained in:
64
config/examples/std.logging.example.json
Normal file
64
config/examples/std.logging.example.json
Normal file
@@ -0,0 +1,64 @@
|
||||
{
|
||||
"format_version": 1,
|
||||
"logs_directory": "${KSP_LOGS_DIRECTORY:-logs}",
|
||||
"default_profile": "example",
|
||||
"profiles": [
|
||||
{
|
||||
"profile_id": "example",
|
||||
"default_filter": "info",
|
||||
"span_events": "new_and_close",
|
||||
"console": {
|
||||
"enabled": true,
|
||||
"output": "stdout",
|
||||
"ansi": true,
|
||||
"format": "pretty",
|
||||
"filter": {
|
||||
"level": "debug",
|
||||
"targets": [
|
||||
"*"
|
||||
],
|
||||
"domains": [
|
||||
"*"
|
||||
]
|
||||
}
|
||||
},
|
||||
"files": [
|
||||
{
|
||||
"output_id": "file.all.info",
|
||||
"enabled": true,
|
||||
"path": "ksp-info.log",
|
||||
"rotation": "daily",
|
||||
"format": "compact",
|
||||
"ansi": false,
|
||||
"filter": {
|
||||
"level": "info",
|
||||
"targets": [
|
||||
"*"
|
||||
],
|
||||
"domains": [
|
||||
"*"
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"output_id": "file.store.trace",
|
||||
"enabled": false,
|
||||
"path": "store/store-trace.jsonl",
|
||||
"rotation": "hourly",
|
||||
"format": "json",
|
||||
"ansi": false,
|
||||
"filter": {
|
||||
"level": "trace",
|
||||
"targets": [
|
||||
"*"
|
||||
],
|
||||
"domains": [
|
||||
"store"
|
||||
]
|
||||
}
|
||||
}
|
||||
],
|
||||
"target_filters": []
|
||||
}
|
||||
]
|
||||
}
|
||||
266
config/schemas/std.logging.schema.json
Normal file
266
config/schemas/std.logging.schema.json
Normal file
@@ -0,0 +1,266 @@
|
||||
{
|
||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||
"$id": "urn:ksp:schema:std.logging:v1",
|
||||
"title": "KSP standard Logging configuration",
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"required": [
|
||||
"format_version",
|
||||
"logs_directory",
|
||||
"default_profile",
|
||||
"profiles"
|
||||
],
|
||||
"properties": {
|
||||
"format_version": {
|
||||
"const": 1
|
||||
},
|
||||
"logs_directory": {
|
||||
"type": "string",
|
||||
"minLength": 1
|
||||
},
|
||||
"default_profile": {
|
||||
"$ref": "#/$defs/profileId"
|
||||
},
|
||||
"profiles": {
|
||||
"type": "array",
|
||||
"minItems": 1,
|
||||
"items": {
|
||||
"$ref": "#/$defs/profile"
|
||||
}
|
||||
}
|
||||
},
|
||||
"$defs": {
|
||||
"profileId": {
|
||||
"type": "string",
|
||||
"pattern": "^[a-z0-9][a-z0-9._-]*$"
|
||||
},
|
||||
"level": {
|
||||
"enum": [
|
||||
"off",
|
||||
"error",
|
||||
"warn",
|
||||
"info",
|
||||
"debug",
|
||||
"trace"
|
||||
]
|
||||
},
|
||||
"format": {
|
||||
"enum": [
|
||||
"human",
|
||||
"compact",
|
||||
"pretty",
|
||||
"json"
|
||||
]
|
||||
},
|
||||
"selectorList": {
|
||||
"type": "array",
|
||||
"minItems": 1,
|
||||
"uniqueItems": true,
|
||||
"items": {
|
||||
"type": "string",
|
||||
"minLength": 1
|
||||
},
|
||||
"allOf": [
|
||||
{
|
||||
"if": {
|
||||
"contains": {
|
||||
"const": "*"
|
||||
}
|
||||
},
|
||||
"then": {
|
||||
"maxItems": 1
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"targetSelectorList": {
|
||||
"allOf": [
|
||||
{
|
||||
"$ref": "#/$defs/selectorList"
|
||||
},
|
||||
{
|
||||
"items": {
|
||||
"anyOf": [
|
||||
{
|
||||
"const": "*"
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"pattern": "^ksp-"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"outputFilter": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"required": [
|
||||
"level",
|
||||
"targets",
|
||||
"domains"
|
||||
],
|
||||
"properties": {
|
||||
"level": {
|
||||
"$ref": "#/$defs/level"
|
||||
},
|
||||
"targets": {
|
||||
"$ref": "#/$defs/targetSelectorList"
|
||||
},
|
||||
"domains": {
|
||||
"$ref": "#/$defs/selectorList"
|
||||
}
|
||||
}
|
||||
},
|
||||
"console": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"required": [
|
||||
"enabled",
|
||||
"output",
|
||||
"ansi",
|
||||
"format",
|
||||
"filter"
|
||||
],
|
||||
"properties": {
|
||||
"enabled": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"output": {
|
||||
"enum": [
|
||||
"stdout",
|
||||
"stderr"
|
||||
]
|
||||
},
|
||||
"ansi": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"format": {
|
||||
"$ref": "#/$defs/format"
|
||||
},
|
||||
"filter": {
|
||||
"$ref": "#/$defs/outputFilter"
|
||||
}
|
||||
},
|
||||
"not": {
|
||||
"properties": {
|
||||
"ansi": {
|
||||
"const": true
|
||||
},
|
||||
"format": {
|
||||
"const": "json"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"ansi",
|
||||
"format"
|
||||
]
|
||||
}
|
||||
},
|
||||
"outputId": {
|
||||
"type": "string",
|
||||
"pattern": "^[a-z0-9][a-z0-9_-]*(\\.[a-z0-9][a-z0-9_-]*)*$"
|
||||
},
|
||||
"file": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"required": [
|
||||
"output_id",
|
||||
"enabled",
|
||||
"path",
|
||||
"rotation",
|
||||
"format",
|
||||
"ansi",
|
||||
"filter"
|
||||
],
|
||||
"properties": {
|
||||
"output_id": {
|
||||
"$ref": "#/$defs/outputId"
|
||||
},
|
||||
"enabled": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"path": {
|
||||
"type": "string",
|
||||
"minLength": 1
|
||||
},
|
||||
"rotation": {
|
||||
"enum": [
|
||||
"never",
|
||||
"hourly",
|
||||
"daily"
|
||||
]
|
||||
},
|
||||
"format": {
|
||||
"$ref": "#/$defs/format"
|
||||
},
|
||||
"ansi": {
|
||||
"const": false
|
||||
},
|
||||
"filter": {
|
||||
"$ref": "#/$defs/outputFilter"
|
||||
}
|
||||
}
|
||||
},
|
||||
"targetFilter": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"required": [
|
||||
"target_prefix",
|
||||
"level"
|
||||
],
|
||||
"properties": {
|
||||
"target_prefix": {
|
||||
"type": "string",
|
||||
"pattern": "^ksp-"
|
||||
},
|
||||
"level": {
|
||||
"$ref": "#/$defs/level"
|
||||
}
|
||||
}
|
||||
},
|
||||
"profile": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"required": [
|
||||
"profile_id",
|
||||
"default_filter",
|
||||
"span_events",
|
||||
"console",
|
||||
"files",
|
||||
"target_filters"
|
||||
],
|
||||
"properties": {
|
||||
"profile_id": {
|
||||
"$ref": "#/$defs/profileId"
|
||||
},
|
||||
"default_filter": {
|
||||
"$ref": "#/$defs/level"
|
||||
},
|
||||
"span_events": {
|
||||
"enum": [
|
||||
"off",
|
||||
"new_and_close",
|
||||
"full"
|
||||
]
|
||||
},
|
||||
"console": {
|
||||
"$ref": "#/$defs/console"
|
||||
},
|
||||
"files": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/$defs/file"
|
||||
}
|
||||
},
|
||||
"target_filters": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/$defs/targetFilter"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
73
config/std.logging.json
Normal file
73
config/std.logging.json
Normal file
@@ -0,0 +1,73 @@
|
||||
{
|
||||
"format_version": 1,
|
||||
"logs_directory": "${KSP_LOGS_DIRECTORY:-logs}",
|
||||
"default_profile": "local_dev",
|
||||
"profiles": [
|
||||
{
|
||||
"profile_id": "local_dev",
|
||||
"default_filter": "warn",
|
||||
"span_events": "new_and_close",
|
||||
"console": {
|
||||
"enabled": true,
|
||||
"output": "stderr",
|
||||
"ansi": true,
|
||||
"format": "compact",
|
||||
"filter": {
|
||||
"level": "debug",
|
||||
"targets": [
|
||||
"*"
|
||||
],
|
||||
"domains": [
|
||||
"*"
|
||||
]
|
||||
}
|
||||
},
|
||||
"files": [
|
||||
{
|
||||
"output_id": "file.all.debug",
|
||||
"enabled": true,
|
||||
"path": "debug/ksp-debug.log",
|
||||
"rotation": "daily",
|
||||
"format": "human",
|
||||
"ansi": false,
|
||||
"filter": {
|
||||
"level": "debug",
|
||||
"targets": [
|
||||
"*"
|
||||
],
|
||||
"domains": [
|
||||
"*"
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"output_id": "file.config.error",
|
||||
"enabled": true,
|
||||
"path": "config/ksp-config-errors.jsonl",
|
||||
"rotation": "daily",
|
||||
"format": "json",
|
||||
"ansi": false,
|
||||
"filter": {
|
||||
"level": "error",
|
||||
"targets": [
|
||||
"ksp-config-lib"
|
||||
],
|
||||
"domains": [
|
||||
"config"
|
||||
]
|
||||
}
|
||||
}
|
||||
],
|
||||
"target_filters": [
|
||||
{
|
||||
"target_prefix": "ksp-config-lib",
|
||||
"level": "trace"
|
||||
},
|
||||
{
|
||||
"target_prefix": "ksp-logging-lib",
|
||||
"level": "debug"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user