Files
khadhroony-solana-project/config/schemas/std.logging.schema.json
2026-08-15 20:57:13 +02:00

266 lines
7.0 KiB
JSON

{
"$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"
}
}
}
}
}
}