diff options
author | Rainer Gerhards <rgerhards@adiscon.com> | 2013-06-28 12:43:26 +0200 |
---|---|---|
committer | Rainer Gerhards <rgerhards@adiscon.com> | 2013-06-28 12:43:26 +0200 |
commit | 19464b9f2b32fc053d3f52ec1e9da1a19bad74b7 (patch) | |
tree | d513cf89d6e592e5c1df68e69726493443de0f92 /plugins/imrelp/imrelp.c | |
parent | c4242a115127f0fbcc158343af3101c18d2eb93e (diff) | |
download | rsyslog-19464b9f2b32fc053d3f52ec1e9da1a19bad74b7.tar.gz rsyslog-19464b9f2b32fc053d3f52ec1e9da1a19bad74b7.tar.bz2 rsyslog-19464b9f2b32fc053d3f52ec1e9da1a19bad74b7.zip |
[io]mrelp: improve error reporting
Diffstat (limited to 'plugins/imrelp/imrelp.c')
-rw-r--r-- | plugins/imrelp/imrelp.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/plugins/imrelp/imrelp.c b/plugins/imrelp/imrelp.c index 18dbfbf2..74cfeb72 100644 --- a/plugins/imrelp/imrelp.c +++ b/plugins/imrelp/imrelp.c @@ -148,6 +148,15 @@ static struct cnfparamblk inppblk = /* ------------------------------ callbacks ------------------------------ */ static void +onErr(void *pUsr, char *objinfo, char* errmesg, __attribute__((unused)) relpRetVal errcode) +{ + instanceConf_t *inst = (instanceConf_t*) pUsr; + errmsg.LogError(0, RS_RET_RELP_AUTH_FAIL, "imrelp[%s]: error '%s', object " + " '%s' - input may not work as intended", + inst->pszBindPort, errmesg, objinfo); +} + +static void onAuthErr(void *pUsr, char *authinfo, char* errmesg, __attribute__((unused)) relpRetVal errcode) { instanceConf_t *inst = (instanceConf_t*) pUsr; @@ -278,6 +287,7 @@ addListner(modConfData_t __attribute__((unused)) *modConf, instanceConf_t *inst) CHKiRet(relpEngineSetFamily(pRelpEngine, glbl.GetDefPFFamily())); CHKiRet(relpEngineSetEnableCmd(pRelpEngine, (uchar*) "syslog", eRelpCmdState_Required)); CHKiRet(relpEngineSetSyslogRcv2(pRelpEngine, onSyslogRcv)); + CHKiRet(relpEngineSetOnErr(pRelpEngine, onErr)); CHKiRet(relpEngineSetOnAuthErr(pRelpEngine, onAuthErr)); if (!glbl.GetDisableDNS()) { CHKiRet(relpEngineSetDnsLookupMode(pRelpEngine, 1)); |