Skip to content

Instantly share code, notes, and snippets.

@turchenkoalex
Last active November 4, 2023 19:05
Show Gist options
  • Save turchenkoalex/ff9dc8443c3002eccf8df58020f82339 to your computer and use it in GitHub Desktop.
Save turchenkoalex/ff9dc8443c3002eccf8df58020f82339 to your computer and use it in GitHub Desktop.
serilog-configuration-schema.json
{
"title": "JSON schema for Serilog.Settings.Configuration",
"$schema": "http://json-schema.org/draft-04/schema",
"type": "object",
"description": "Serilog configuration",
"definitions": {
"libraries": {
"type": "array",
"description": "Serilog Sinks Libraries",
"items": {
"type": "string",
"minLength": 1
},
"uniqueItems": true
},
"loggingLevel": {
"type": "string",
"description": "Specifies the meaning and relative importance of a log event.",
"oneOf": [
{
"enum": [
"Verbose"
],
"description": "Anything and everything you might want to know about a running block of code."
},
{
"enum": [
"Debug"
],
"description": "Internal system events that aren't necessarily observable from the outside."
},
{
"enum": [
"Information"
],
"description": "The lifeblood of operational intelligence - things happen."
},
{
"enum": [
"Warning"
],
"description": "Service is degraded or endangered."
},
{
"enum": [
"Error"
],
"description": "Functionality is unavailable, invariants are broken or data is lost."
},
{
"enum": [
"Fatal"
],
"description": "If you have a pager, it goes off when one of these occurs."
}
]
},
"minimumLevel": {
"description": "The minimum level at which events will be passed to sinks.",
"oneOf": [
{
"$ref": "#/definitions/loggingLevel"
},
{
"type": "object",
"properties": {
"Default": {
"$ref": "#/definitions/loggingLevel",
"description": "Default minimum logging level"
},
"Override": {
"type": "object",
"description": "Override the minimum level for events from a specific namespace or type name.",
"additionalProperties": {
"$ref": "#/definitions/loggingLevel"
}
}
},
"required": [
"Default"
]
}
]
},
"sink": {
"description": "Serilog Sink",
"oneOf": [
{
"type": "string",
"minLength": 1
},
{
"type": "object",
"properties": {
"Name": {
"description": "Sink class name",
"type": "string",
"minLength": 1
},
"Args": {
"description": "Sink arguments",
"type": "object"
}
},
"required": [
"Name"
]
}
]
}
},
"properties": {
"Using": {
"$ref": "#/definitions/libraries"
},
"MinimumLevel": {
"$ref": "#/definitions/minimumLevel"
},
"WriteTo": {
"description": "Serilog Sinks",
"type": "array",
"items": {
"$ref": "#/definitions/sink"
}
},
"Enrich": {
"description": "Serilog Enrich",
"type": "array",
"items": {
"$ref": "#/definitions/sink"
}
},
"Properties": {
"type": "object",
"description": "Additional properties"
}
},
"required": [
"Using",
"MinimumLevel",
"WriteTo"
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment