summaryrefslogtreecommitdiffstats
path: root/syslogd.c
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2008-03-28 10:02:22 +0000
committerRainer Gerhards <rgerhards@adiscon.com>2008-03-28 10:02:22 +0000
commitf2fcb032110bc4b590c96b70518a4e1e1e03b279 (patch)
tree31681d4274e556988f1c841160a63fd26cfb8578 /syslogd.c
parentf4f27d790c811a9c54fff4dc68cbf6896f2d846a (diff)
downloadrsyslog-f2fcb032110bc4b590c96b70518a4e1e1e03b279.zip
rsyslog-f2fcb032110bc4b590c96b70518a4e1e1e03b279.tar.gz
rsyslog-f2fcb032110bc4b590c96b70518a4e1e1e03b279.tar.xz
- changed default file output format to include high-precision timestamps
- added a buid-in template for previous syslogd file format - added new $ActionFileDefaultTemplate directive
Diffstat (limited to 'syslogd.c')
-rw-r--r--syslogd.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/syslogd.c b/syslogd.c
index 2b569f1..228b44e 100644
--- a/syslogd.c
+++ b/syslogd.c
@@ -417,7 +417,8 @@ int option_DisallowWarning = 1; /* complain if message from disallowed sender is
/* hardcoded standard templates (used for defaults) */
-static uchar template_TraditionalFormat[] = "\"%TIMESTAMP% %HOSTNAME% %syslogtag%%msg:::drop-last-lf%\n\"";
+static uchar template_TraditionalFileFormat[] = "\"%TIMESTAMP% %HOSTNAME% %syslogtag%%msg:::drop-last-lf%\n\"";
+static uchar template_FileFormat[] = "\"%TIMESTAMP:::date-rfc3339% %HOSTNAME% %syslogtag%%msg:::drop-last-lf%\n\"";
static uchar template_WallFmt[] = "\"\r\n\7Message from syslogd@%HOSTNAME% at %timegenerated% ...\r\n %syslogtag%%msg%\n\r\"";
static uchar template_StdFwdFmt[] = "\"<%PRI%>%TIMESTAMP% %HOSTNAME% %syslogtag%%msg%\"";
static uchar template_StdUsrMsgFmt[] = "\" %syslogtag%%msg%\n\r\"";
@@ -2811,8 +2812,10 @@ static void mainThread()
* we use template names with a SP in front - these
* can NOT be generated via the configuration file
*/
- pTmp = template_TraditionalFormat;
- tplAddLine(" TradFmt", &pTmp);
+ pTmp = template_FileFormat; /* new format for files with high-precision stamp */
+ tplAddLine("RSYSLOG_FileFormat", &pTmp);
+ pTmp = template_TraditionalFileFormat;
+ tplAddLine("RSYSLOG_TraditionalFileFormat", &pTmp);
pTmp = template_WallFmt;
tplAddLine(" WallFmt", &pTmp);
pTmp = template_StdFwdFmt;