From ba0f23182a55b26b2265d2138c707cbc7ddbb72e Mon Sep 17 00:00:00 2001 From: Rainer Gerhards Date: Wed, 17 Mar 2010 16:25:24 +0100 Subject: new feature: "." action type added to support writing files to relative pathes (this is primarily meant as a debug aid) --- ChangeLog | 2 ++ doc/rsyslog_conf_actions.html | 11 +++++++++-- tools/omfile.c | 3 ++- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 829e64b2..1f74b252 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,7 @@ --------------------------------------------------------------------------- Version 4.6.2 [v4-stable] (rgerhards), 2010-03-?? +- new feature: "." action type added to support writing files to relative + pathes (this is primarily meant as a debug aid) - added new property replacer option "date-rfc3164-buggyday" primarily to ease migration from syslog-ng. See property replacer doc for details. [backport from 5.5.3 because urgently needed by some] diff --git a/doc/rsyslog_conf_actions.html b/doc/rsyslog_conf_actions.html index 8c4b9cfc..6020dd88 100644 --- a/doc/rsyslog_conf_actions.html +++ b/doc/rsyslog_conf_actions.html @@ -37,8 +37,15 @@ compared to the otherwise-equal config directives below:

*.=crit /var/log/critmsgs

 

Regular File

-

Typically messages are logged to real files. The file has to -be specified with full pathname, beginning with a slash "/''.
+

Typically messages are logged to real files. The file usually is +specified by full pathname, beginning with a slash "/". +Starting with version 4.6.2 and 5.4.1 (previous v5 version do NOT support this) +relative file names can also be specified. To do so, these must begin with a +dot. For example, use "./file-in-current-dir.log" to specify a file in the +current directory. Please note that rsyslogd usually changes its working +directory to the root, so relative file names must be tested with care (they +were introduced primarily as a debugging vehicle, but may have useful other applications +as well).


You may prefix each entry with the minus "-'' sign to omit syncing the diff --git a/tools/omfile.c b/tools/omfile.c index daefa680..438f8c4a 100644 --- a/tools/omfile.c +++ b/tools/omfile.c @@ -633,7 +633,7 @@ ENDdoAction BEGINparseSelectorAct CODESTARTparseSelectorAct - if(!(*p == '$' || *p == '?' || *p == '/' || *p == '-')) + if(!(*p == '$' || *p == '?' || *p == '/' || *p == '.' || *p == '-')) ABORT_FINALIZE(RS_RET_CONFLINE_UNPROCESSED); CHKiRet(createInstance(&pData)); @@ -683,6 +683,7 @@ CODESTARTparseSelectorAct * need high-performance pipes at a later stage (unlikely). -- rgerhards, 2010-02-28 */ case '/': + case '.': CODE_STD_STRING_REQUESTparseSelectorAct(1) /* we now have *almost* the same semantics for files and pipes, but we still need * to know we deal with a pipe, because we must do non-blocking opens in that case -- cgit