{"record":{"id":"ed89eecf53d9a3b2","repo":"crowdsecurity/crowdsec","slug":"log-media-syslog-is-not-supported-on-windows","errorCode":null,"errorMessage":"log_media=\"syslog\" is not supported on windows","messagePattern":"log_media=\"syslog\" is not supported on windows","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/logging/syslog_windows.go","lineNumber":8,"sourceCode":"package logging\n\nimport (\n\t\"errors\"\n)\n\nfunc setupSyslogDefault() error {\n\treturn errors.New(`log_media=\"syslog\" is not supported on windows`)\n}\n","sourceCodeStart":1,"sourceCodeEnd":10,"githubUrl":"https://github.com/crowdsecurity/crowdsec/blob/909b5157986a2b2c2163300fdaef5ed01289f7d2/pkg/logging/syslog_windows.go#L1-L10","documentation":"Platform stub for syslog logging on Windows. The crowdsec Windows build does not implement a syslog log medium because syslog is a Unix facility, so setupSyslogDefault (the syslog backend initializer) unconditionally returns this error instead of configuring a logger.","triggerScenarios":"Setting log_media: syslog in crowdsec.yaml (or via -o syslog style configuration) and starting crowdsec on a Windows machine; the logging subsystem calls the windows-specific setupSyslogDefault which always fails.","commonSituations":"Copying a Linux crowdsec.yaml to a Windows server unchanged, migrating configs between hosts with different OSes, or following Linux-oriented setup guides.","solutions":["Change log_media in the config to 'file' (or 'stdout') on Windows.","If syslog forwarding is required, log to a file and ship it to syslog/rsyslog with an external agent (e.g. nxlog, filebeat, syslog-ng).","Run crowdsec on a Linux host if native syslog output is a hard requirement."],"exampleFix":"// before (crowdsec.yaml)\nlog_media: syslog\n// after\nlog_media: file\nlog_dir: C:\\ProgramData\\crowdsec\\logs\\","handlingStrategy":"validation","validationCode":"if runtime.GOOS == \"windows\" && cfg.LogMedia == \"syslog\" {\n    return errors.New(\"syslog log_media unsupported on windows; use file or stdout\")\n}","typeGuard":null,"tryCatchPattern":"if err := setupLogging(cfg); err != nil {\n    log.Fatalf(\"logging setup failed: %v\", err) // fallback to stdout\n}","preventionTips":["Keep per-OS config profiles instead of copying Linux configs to Windows","Prefer log_media: file on Windows hosts","Document syslog forwarding via an external agent for Windows deployments"],"tags":["windows","logging","syslog","platform"],"backgroundTag":"unsupported-platform","analyzedSha":"909b5157986a2b2c2163300fdaef5ed01289f7d2","analyzedAt":"2026-09-06T12:27:26.012Z","contentChangedAt":"2026-09-06T12:27:26.012Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}