diff options
Diffstat (limited to 'plugins/imklog/imklog.c')
-rw-r--r-- | plugins/imklog/imklog.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/plugins/imklog/imklog.c b/plugins/imklog/imklog.c index c6fb1592..5bd99d9e 100644 --- a/plugins/imklog/imklog.c +++ b/plugins/imklog/imklog.c @@ -45,21 +45,23 @@ #include <stdarg.h> #include <ctype.h> -#include "syslogd.h" +#include "dirty.h" #include "cfsysline.h" #include "obj.h" #include "msg.h" #include "module-template.h" #include "datetime.h" #include "imklog.h" +#include "glbl.h" MODULE_TYPE_INPUT /* Module static data */ DEF_IMOD_STATIC_DATA DEFobjCurrIf(datetime) +DEFobjCurrIf(glbl) -/* configuration settings TODO: move to instance data? */ +/* configuration settings */ int dbgPrintSymbols = 0; /* this one is extern so the helpers can access it! */ int symbols_twice = 0; int use_syscall = 0; @@ -95,7 +97,9 @@ enqMsg(uchar *msg, uchar* pszTag, int iFacility, int iSeverity) MsgSetUxTradMsg(pMsg, (char*)msg); MsgSetRawMsg(pMsg, (char*)msg); MsgSetMSG(pMsg, (char*)msg); - MsgSetHOSTNAME(pMsg, (char*)LocalHostName); + MsgSetRcvFrom(pMsg, (char*)glbl.GetLocalHostName()); + MsgSetRcvFromIP(pMsg, (uchar*)"127.0.0.1"); + MsgSetHOSTNAME(pMsg, (char*)glbl.GetLocalHostName()); MsgSetTAG(pMsg, (char*)pszTag); pMsg->iFacility = LOG_FAC(iFacility); pMsg->iSeverity = LOG_PRI(iSeverity); @@ -225,6 +229,7 @@ ENDafterRun BEGINmodExit CODESTARTmodExit /* release objects we used */ + objRelease(glbl, CORE_COMPONENT); objRelease(datetime, CORE_COMPONENT); ENDmodExit @@ -251,6 +256,7 @@ CODESTARTmodInit *ipIFVersProvided = CURR_MOD_IF_VERSION; /* we only support the current interface specification */ CODEmodInit_QueryRegCFSLineHdlr CHKiRet(objUse(datetime, CORE_COMPONENT)); + CHKiRet(objUse(glbl, CORE_COMPONENT)); iFacilIntMsg = klogFacilIntMsg(); |