file-logger: Add option to log messages as JSON objects

Closes strongswan/strongswan#2222
This commit is contained in:
Tobias Brunner
2024-10-25 14:45:12 +02:00
parent c87aae300a
commit a2fba6db4a
5 changed files with 110 additions and 53 deletions
+12 -2
View File
@@ -26,8 +26,18 @@ charon.filelog.<name>.flush_line = no
Enabling this option disables block buffering and enables line buffering.
charon.filelog.<name>.ike_name = no
Prefix each log entry with the connection name and a unique numerical
identifier for each IKE_SA.
Add the connection name and a unique numerical identifier for the current
IKE_SA to each log entry if available.
charon.filelog.<name>.json = no
If enabled, each log entry is written to the file as a JSON object.
Enables writing each log entry as a JSON object to the file. The properties
are "time" (if `time_format` is set), "thread", "group", "level" and "msg".
Newlines, double quotes and backslashes are escaped in the latter. If
`ike_name` is enabled, "ikesa-uniqueid" and "ikesa-name" are added to the
object if available. The `log_level` option does not apply if this is
enabled.
charon.filelog.<name>.log_level = no
Add the log level of each message after the subsystem (e.g. [IKE2]).