charon has a flexible logging system that lets you route log output to files, syslog, and stderr simultaneously, with independent verbosity settings per subsystem.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/strongswan/strongswan/llms.txt
Use this file to discover all available pages before exploring further.
Log subsystems
charon divides its internal activity into named groups. You can set a verbosity level for each group independently.| Group | Description |
|---|---|
dmn | Daemon management — startup, shutdown, plugin loading. |
mgr | IKE_SA manager — SA lookup and checkout. |
ike | IKE protocol messages and state machine. |
chd | CHILD_SA establishment and teardown. |
job | Job processing and scheduling. |
cfg | Configuration loading and parsing. |
knl | Kernel interface — XFRM policy and SA installation. |
net | Network socket — packet send/receive. |
asn | ASN.1 parsing (certificates, keys). |
enc | IKE message encoding and decoding. |
tls | TLS-based EAP methods (EAP-TLS, EAP-TTLS, EAP-PEAP). |
esp | ESP packet processing. |
lib | libstrongswan core library. |
Log levels
| Level | Meaning |
|---|---|
-1 | Silent — no output for this group. |
0 | Errors and critical messages only. |
1 | Informational (default). |
2 | More verbose — useful for debugging connection problems. |
3 | Debug — includes raw message details. |
4 | Most verbose — includes internal state tracing. |
default sets the level for all groups not explicitly listed.
Configuring log destinations
Logging is configured undercharon { } in strongswan.conf. You can define multiple destinations — each runs independently.
File logging
| Option | Description |
|---|---|
default | Fallback level for all groups not listed. |
flush_line | Flush after every line. Prevents log loss on crashes. Default is no. |
time_format | strftime-compatible timestamp format. Omit to suppress timestamps. |
append | Append to existing file (yes, default) or overwrite on start. |
Syslog
syslog is the syslog facility (daemon, auth, local0–local7, etc.). You can route different groups to different facilities.
stderr
Combining destinations
You can log to multiple destinations simultaneously. A common production setup writes informational logs to a file and IKE detail to a separate debug log:Increasing verbosity for troubleshooting
Identify the relevant subsystem
For connection failures, start with
ike = 2 and knl = 2. For certificate issues add cfg = 2 and asn = 1. For traffic not flowing, add esp = 2.Reload settings without restarting
strongswan.conf and applies the new log levels immediately. Active tunnels are not affected.Live log streaming
Log rotation
Uselogrotate with a postrotate script to signal charon to reopen the log file:
--reload-settings causes charon to close and reopen all configured log files, picking up the new (empty) file created by logrotate.