Skip to content

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

FieldTypeDefaultAllowed valuesDescription
log-levellog.LogLevelinfodebug | info | warning | error | silentMinimum 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: info

Silence mihomo entirely (useful when another process consumes the log pipeline):

yaml
log-level: silent

Verbose tracing for troubleshooting:

yaml
log-level: debug

Notes

  • The default at config/config.go:484 resolves to log.INFO. If the YAML omits log-level, mihomo runs at info.
  • mihomo's level set differs from sing-box's: there is no trace, no short warn (must be the full word warning), no fatal, no panic. See log/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)

Core Tutorial by Argsment