diff options
author | Rainer Gerhards <rgerhards@adiscon.com> | 2012-11-22 09:45:05 +0100 |
---|---|---|
committer | Rainer Gerhards <rgerhards@adiscon.com> | 2012-11-22 09:45:05 +0100 |
commit | 84a5d7b138fd6366cf2964585f330e663b96d10e (patch) | |
tree | 078ebcaf8b68e86c7ddf72f628a8aacf5a7cc770 /plugins/imklog/imklog.c | |
parent | ef9128a9f92f2a68ac0fb5db27ded192a258df13 (diff) | |
parent | b78af2aaf546cee90671513be39d8e3717f2ace6 (diff) | |
download | rsyslog-84a5d7b138fd6366cf2964585f330e663b96d10e.tar.gz rsyslog-84a5d7b138fd6366cf2964585f330e663b96d10e.tar.bz2 rsyslog-84a5d7b138fd6366cf2964585f330e663b96d10e.zip |
Merge branch 'v5-stable' into v6-stable
Note: this was not a simple merge, I rather needed to adopt the v5 code to
the new v6 config handling. However, no v6 config format has been added yet
(this is the next step).
Conflicts:
plugins/imklog/imklog.c
plugins/imklog/imklog.h
Diffstat (limited to 'plugins/imklog/imklog.c')
-rw-r--r-- | plugins/imklog/imklog.c | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/plugins/imklog/imklog.c b/plugins/imklog/imklog.c index 93323707..7a1078f8 100644 --- a/plugins/imklog/imklog.c +++ b/plugins/imklog/imklog.c @@ -77,6 +77,8 @@ DEFobjCurrIf(errmsg) /* config settings */ typedef struct configSettings_s { int bPermitNonKernel; /* permit logging of messages not having LOG_KERN facility */ + int bParseKernelStamp; /* if try to parse kernel timestamps for message time */ + int bKeepKernelStamp; /* keep the kernel timestamp in the message */ int iFacilIntMsg; /* the facility to use for internal messages (set by driver) */ uchar *pszPath; int console_log_level; /* still used for BSD */ @@ -100,16 +102,15 @@ static struct cnfparamblk modpblk = modpdescr }; - - static prop_t *pInputName = NULL; /* there is only one global inputName for all messages generated by this module */ static prop_t *pLocalHostIP = NULL; /* a pseudo-constant propterty for 127.0.0.1 */ - static inline void initConfigSettings(void) { cs.bPermitNonKernel = 0; + cs.bParseKernelStamp = 0; + cs.bKeepKernelStamp = 0; cs.console_log_level = -1; cs.pszPath = NULL; cs.iFacilIntMsg = klogFacilIntMsg(); @@ -288,6 +289,8 @@ CODESTARTbeginCnfLoad /* init our settings */ pModConf->pszPath = NULL; pModConf->bPermitNonKernel = 0; + pModConf->bParseKernelStamp = 0; + pModConf->bKeepKernelStamp = 0; pModConf->console_log_level = -1; pModConf->iFacilIntMsg = klogFacilIntMsg(); loadModConf->configSetViaV2Method = 0; @@ -345,6 +348,8 @@ CODESTARTendCnfLoad if(!loadModConf->configSetViaV2Method) { /* persist module-specific settings from legacy config system */ loadModConf->bPermitNonKernel = cs.bPermitNonKernel; + loadModConf->bParseKernelStamp = cs.bParseKernelStamp; + loadModConf->bKeepKernelStamp = cs.bKeepKernelStamp; loadModConf->iFacilIntMsg = cs.iFacilIntMsg; loadModConf->console_log_level = cs.console_log_level; if((cs.pszPath == NULL) || (cs.pszPath[0] == '\0')) { @@ -421,6 +426,8 @@ ENDqueryEtryPt static rsRetVal resetConfigVariables(uchar __attribute__((unused)) *pp, void __attribute__((unused)) *pVal) { cs.bPermitNonKernel = 0; + cs.bParseKernelStamp = 0; + cs.bKeepKernelStamp = 0; if(cs.pszPath != NULL) { free(cs.pszPath); cs.pszPath = NULL; @@ -462,6 +469,10 @@ CODEmodInit_QueryRegCFSLineHdlr NULL, &cs.console_log_level, STD_LOADABLE_MODULE_ID, &bLegacyCnfModGlobalsPermitted)); CHKiRet(regCfSysLineHdlr2((uchar *)"kloginternalmsgfacility", 0, eCmdHdlrFacility, NULL, &cs.iFacilIntMsg, STD_LOADABLE_MODULE_ID, &bLegacyCnfModGlobalsPermitted)); + CHKiRet(regCfSysLineHdlr2((uchar *)"klogparsekerneltimestamp", 0, eCmdHdlrBinary, + NULL, &cs.bParseKernelStamp, STD_LOADABLE_MODULE_ID, &bLegacyCnfModGlobalsPermitted)); + CHKiRet(regCfSysLineHdlr2((uchar *)"klogkeepkerneltimestamp", 0, eCmdHdlrBinary, + NULL, &cs.bKeepKernelStamp, STD_LOADABLE_MODULE_ID, &bLegacyCnfModGlobalsPermitted)); CHKiRet(omsdRegCFSLineHdlr((uchar *)"resetconfigvariables", 1, eCmdHdlrCustomHandler, resetConfigVariables, NULL, STD_LOADABLE_MODULE_ID)); ENDmodInit |