# HG changeset patch # User Matthew Wild # Date 1602870075 -3600 # Node ID b3dd77f2d0d76b83843502b5aec6e3282c726bc5 # Parent f917bb78ab67c9aae0f5e58c6984623f34847669 mod_log_ringbuffer: Switch `filename` to not be interpolated, add filename_template which is diff -r f917bb78ab67 -r b3dd77f2d0d7 mod_log_ringbuffer/README.markdown --- 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 diff -r f917bb78ab67 -r b3dd77f2d0d7 mod_log_ringbuffer/mod_log_ringbuffer.lua --- 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