Log
Unlike Xray-core and sing-box, mihomo has no nested log block — logging is controlled by a single top-level YAML key, log-level. There is no log-file setting in the YAML schema; redirection is done by the service manager (systemd, launchd, Docker) or a > file shell redirect.
Options
| Field | Type | Default | Allowed values | Description |
|---|---|---|---|---|
log-level | log.LogLevel | info | debug | info | warning | error | silent | Minimum severity to emit. The value "silent" disables all log output. |
Source: config/config.go:393-460 · pinned at v1.19.27 (5184081)
Examples
Default config — info is implicit if the key is omitted:
yaml
log-level: infoSilence mihomo entirely (useful when another process consumes the log pipeline):
yaml
log-level: silentVerbose tracing for troubleshooting:
yaml
log-level: debugNotes
- The default at
config/config.go:484resolves tolog.INFO. If the YAML omitslog-level, mihomo runs atinfo. - mihomo's level set differs from sing-box's: there is no
trace, no shortwarn(must be the full wordwarning), nofatal, nopanic. Seelog/level.go:5-30. - To write to a file, run mihomo with shell redirection or a service manager — there is no in-config file path option.
Source: config/config.go:393-460 · v1.19.27 (5184081)
