# Logging Configuration Fragment
# Optional for all services

[[elements]]
border_top = true
border_bottom = false
name = "logging_section_header"
title = "📝 Logging Configuration"
type = "section_header"

[[elements]]
default = "info"
help = "Log level (debug, info, warn, error)"
name = "logging_level"
nickel_path = ["logging", "level"]
options = ["debug", "info", "warn", "error"]
prompt = "Log Level"
type = "select"

[[elements]]
default = "text"
help = "Log format (text, json)"
name = "logging_format"
nickel_path = ["logging", "format"]
options = ["text", "json"]
prompt = "Log Format"
type = "select"

[[elements]]
default = false
help = "Enable file-based logging with rotation"
name = "logging_file_enabled"
nickel_path = ["logging", "file", "enabled"]
prompt = "Enable File Logging"
type = "confirm"

[[elements]]
condition = "logging_file_enabled == true"
default = 10485760
help = "Maximum log file size in bytes before rotation (range: ${constraint.common.logging.max_file_size.min}-${constraint.common.logging.max_file_size.max})"
max = "${constraint.common.logging.max_file_size.max}"
min = "${constraint.common.logging.max_file_size.min}"
name = "logging_max_file_size"
nickel_path = ["logging", "file", "max_size"]
prompt = "Max File Size (bytes)"
type = "number"

[[elements]]
condition = "logging_file_enabled == true"
default = 10
help = "Maximum number of backup log files to keep (range: ${constraint.common.logging.max_backups.min}-${constraint.common.logging.max_backups.max})"
max = "${constraint.common.logging.max_backups.max}"
min = "${constraint.common.logging.max_backups.min}"
name = "logging_max_backups"
nickel_path = ["logging", "file", "max_backups"]
prompt = "Max Backup Files"
type = "number"
