{"record":{"id":"a3fe96c530b973d3","repo":"shadowsocks/shadowsocks-rust","slug":"unsupported-syslog-facility","errorCode":null,"errorMessage":"unsupported syslog facility: {}","messagePattern":"unsupported syslog facility: (.+?)","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/logging/tracing.rs","lineNumber":209,"sourceCode":"        Some(f) => match f {\n            1 => Facility::User,\n            2 => Facility::Mail,\n            3 => Facility::Daemon,\n            4 => Facility::Auth,\n            6 => Facility::Lpr,\n            7 => Facility::News,\n            8 => Facility::Uucp,\n            9 => Facility::Cron,\n            10 => Facility::AuthPriv,\n            16 => Facility::Local0,\n            17 => Facility::Local1,\n            18 => Facility::Local2,\n            19 => Facility::Local3,\n            20 => Facility::Local4,\n            21 => Facility::Local5,\n            22 => Facility::Local6,\n            23 => Facility::Local7,\n            _ => panic!(\"unsupported syslog facility: {}\", f),\n        },\n    };\n    let options = Options::default();\n    let identity = CString::new(identity).expect(\"syslog identity contains null-byte ('\\\\0')\");\n\n    match Syslog::new(identity, options, facility) {\n        Some(l) => l,\n        None => panic!(\"syslog is already initialized\"),\n    }\n}\n","sourceCodeStart":191,"sourceCodeEnd":220,"githubUrl":"https://github.com/shadowsocks/shadowsocks-rust/blob/8eb0f0a65b1d976ab6bed5787327ef86529b0435/src/logging/tracing.rs#L191-L220","documentation":"make_syslog_writer maps a numeric syslog facility (0-23) to the syslog crate's Facility enum and panics on any value outside that range. The facility number comes from configuration (e.g. `log-syslog-facility`); only LOG_KERN(0) through LOG_LOCAL7(23) are valid. This is a configuration validation failure at logging setup time.","triggerScenarios":"Calling make_syslog_writer (via make_layer) with a facility integer > 23 (or otherwise unmapped), e.g. `log-syslog-facility: 24` in the config when syslog logging is enabled.","commonSituations":"Typos in config producing the wrong number; copying facility codes from other software that uses a different numbering; assuming arbitrary integers are accepted.","solutions":["Set the syslog facility to a valid value 0-23 (typically 19 for LOG_LOCAL3 or another LOCAL*)","Remove the facility key to use the default facility","Consult syslog(3) facility numbering (USER=1, DAEMON=3, LOCAL0=16 ... LOCAL7=23)"],"exampleFix":"// before (config.json)\n\"log-syslog\": 1,\n\"log-syslog-facility\": 24\n// after\n\"log-syslog\": 1,\n\"log-syslog-facility\": 19","handlingStrategy":"validation","validationCode":"# validate facility in config before launch:\nfacility=$(jq '.log-syslog-facility // 19' config.json); [ \"$facility\" -ge 0 ] && [ \"$facility\" -le 23 ] || exit 1","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use facility values 0-23 only, favoring LOCAL0-LOCAL7 (16-23)","Validate config with a schema check before deployment","Omit the facility key to accept the default","Cross-check facility integers against syslog(3) numbering"],"tags":["panic","logging","syslog","configuration"],"backgroundTag":"invalid-config-value","analyzedSha":"8eb0f0a65b1d976ab6bed5787327ef86529b0435","analyzedAt":"2026-09-09T12:20:43.168Z","contentChangedAt":"2026-09-09T12:20:43.168Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}