summaryrefslogtreecommitdiffstats
path: root/plugins/imklog/imklog.c
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/imklog/imklog.c')
-rw-r--r--plugins/imklog/imklog.c17
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