mod_log_ringbuffer: Switch `filename` to not be interpolated, add filename_template which is
--- a/mod_log_ringbuffer/README.markdown Fri Oct 16 18:40:29 2020 +0100
+++ b/mod_log_ringbuffer/README.markdown Fri Oct 16 18:41:15 2020 +0100
@@ -51,8 +51,11 @@
old data will be overwritten by new data.
`filename`
-: The name of the file to dump logs to when triggered. The filename may
- contain a number of variables, described below. Defaults to
+: The name of the file to dump logs to when triggered.
+
+`filename_template`
+: This parameter may optionally be specified instead of `filename. It
+ may contain a number of variables, described below. Defaults to
`"{paths.data}/ringbuffer-logs-{pid}-{count}.log"`.
Only one of the following triggers may be specified:
@@ -68,6 +71,9 @@
## Filename variables
+If `filename_template` is specified instead of `filename`, it may contain
+any of the following variables in curly braces, e.g. `{pid}`.
+
`pid`
: The PID of the current process
--- a/mod_log_ringbuffer/mod_log_ringbuffer.lua Fri Oct 16 18:40:29 2020 +0100
+++ b/mod_log_ringbuffer/mod_log_ringbuffer.lua Fri Oct 16 18:41:15 2020 +0100
@@ -68,7 +68,7 @@
end
local function dump()
- dump_buffer(buffer, get_filename(sink_config.filename));
+ dump_buffer(buffer, sink_config.filename or get_filename(sink_config.filename_template));
end
if sink_config.signal then