{
  "$schema": "https://apidocs.iqrf.org/iqrf-gateway-daemon/com.iqrftech.self-desc/schema/jsonschema/1-0-0#",
  "self": {
    "vendor": "com.iqrftech.self-desc",
    "name": "schema__shape__TraceFileService",
    "format": "jsonschema",
    "version": "1-0-0"
  },
  "type": "object",
  "required": [
    "component",
    "instance",
    "path",
    "filename",
    "VerbosityLevels"
  ],
  "additionalProperties": false,
  "properties": {
    "component": {
      "title": "Component name",
      "description": "Name of component.",
      "type": "string",
      "enum": [
        "shape::TraceFileService"
      ]
    },
    "instance": {
      "title": "Instance name",
      "description": "Name of component instance.",
      "type": "string",
      "pattern": "^[a-zA-Z0-9-]+$",
      "example": "shape::TraceFileService-1"
    },
    "path": {
      "title": "Logging directory",
      "description": "Path to directory containing log files.",
      "type": "string",
      "example": ""
    },
    "filename": {
      "title": "Log file name",
      "description": "Name of the logging file.",
      "type": "string",
      "pattern": "^[A-Za-z0-9][A-Za-z0-9_-]*(\\.[A-Za-z0-9_-]+)*$",
      "example": "IqrfDaemon.txt"
    },
    "maxSizeMB": {
      "title": "Maximum file size",
      "description": "Maximum size of the log file. Size is in MB.",
      "type": "integer",
      "minimum": 0,
      "example": 10
    },
    "timestampFiles": {
      "title": "Timestamp files",
      "description": "The file is timestamped in format YYY-MM-DD-hh-mm-ss-mss-<filename> to avoid overwrite.",
      "type": "boolean",
      "example": false
    },
    "maxAgeMinutes": {
      "title": "Maximum log file lifetime",
      "description": "Maximum age of the timestamped files in minutes. If set to zero or not present it is not applied.",
      "type": "integer",
      "minimum": 0,
      "example": 0
    },
    "maxNumber": {
      "title": "Maxinum number of log files",
      "description": "Maximum number of the timestamped files. If set to zero or not present it is not applied.",
      "type": "integer",
      "minimum": 0,
      "example": 0
    },
    "VerbosityLevels": {
      "type": "array",
      "description": "Array of pairs channel and verbosity level",
      "items": {
        "type": "object",
        "properties": {
          "channel": {
            "type": "integer",
            "default": 0,
            "description": "The channel to be routed to the file"
          },
          "level": {
            "type": "string",
            "default": "DBG",
            "description": "Set level of trace",
            "enum": [
              "DBG",
              "INF",
              "WAR",
              "ERR"
            ]
          }
        },
        "required": [
          "channel",
          "level"
        ]
      }
    }
  }
}
