{
    "$schema": "http://json-schema.org/draft-07/schema#",
    "$id": "https://apidocs.iqrf.org/openapi/iqrf-gateway-webapp/v2.7.0-rc3/schemas/journal.json",
    "type": "object",
    "title": "Journal configuration",
    "example": {
        "forwardToSyslog": false,
        "persistence": "volatile",
        "maxDiskSize": 0,
        "maxFiles": 100,
        "sizeRotation": {
            "maxFileSize": 0
        },
        "timeRotation": {
            "unit": "month",
            "count": 1
        }
    },
    "required": [
        "forwardToSyslog",
        "persistence",
        "maxDiskSize",
        "maxFiles",
        "sizeRotation",
        "timeRotation"
    ],
    "additionalProperties": false,
    "properties": {
        "forwardToSyslog": {
            "title": "Forward Journal logs to syslog",
            "type": "boolean",
            "example": false
        },
        "persistence": {
            "title": "Journal persistence",
            "type": "string",
            "enum": [
                "persistent",
                "volatile"
            ],
            "example": "volatile"
        },
        "maxDiskSize": {
            "title": "Maximum disk space in MB that journal can use",
            "description": "Setting 0 uses Journal default",
            "type": "integer",
            "minimum": 0,
            "example": 0
        },
        "maxFiles": {
            "title": "Number of log files to keep",
            "type": "integer",
            "example": 100
        },
        "sizeRotation": {
            "title": "Size-based log rotation",
            "type": "object",
            "required": [
                "maxFileSize"
            ],
            "additionalProperties": false,
            "properties": {
                "maxFileSize": {
                    "title": "Maximum log file size in MB",
                    "description": "Setting 0 uses Journal default",
                    "type": "integer",
                    "minimum": 0,
                    "example": 0
                }
            }
        },
        "timeRotation": {
            "title": "Time-based log rotation",
            "type": "object",
            "required": [
                "count",
                "unit"
            ],
            "additionalProperties": false,
            "properties": {
                "unit": {
                    "title": "Time unit",
                    "type": "string",
                    "enum": [
                        "s",
                        "m",
                        "h",
                        "day",
                        "week",
                        "month",
                        "year"
                    ],
                    "example": "month"
                },
                "count": {
                    "title": "Unit count",
                    "type": "integer",
                    "minimum": 1,
                    "example": 1
                }
            }
        }
    }
}
