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/omrelp/omrelp.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/omrelp/omrelp.c')
-rw-r--r-- | plugins/omrelp/omrelp.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/plugins/omrelp/omrelp.c b/plugins/omrelp/omrelp.c index a3dac025..bc27b402 100644 --- a/plugins/omrelp/omrelp.c +++ b/plugins/omrelp/omrelp.c @@ -131,6 +131,15 @@ static uchar *getRelpPt(instanceData *pData) } static void +onErr(void *pUsr, char *objinfo, char* errmesg, __attribute__((unused)) relpRetVal errcode) +{ + instanceData *pData = (instanceData*) pUsr; + errmsg.LogError(0, RS_RET_RELP_AUTH_FAIL, "omrelp[%s:%s]: error '%s', object " + " '%s' - action may not work as intended", + pData->target, pData->port, errmesg, objinfo); +} + +static void onAuthErr(void *pUsr, char *authinfo, char* errmesg, __attribute__((unused)) relpRetVal errcode) { instanceData *pData = (instanceData*) pUsr; @@ -512,6 +521,7 @@ CODEmodInit_QueryRegCFSLineHdlr CHKiRet(relpEngineConstruct(&pRelpEngine)); CHKiRet(relpEngineSetDbgprint(pRelpEngine, dbgprintf)); CHKiRet(relpEngineSetOnAuthErr(pRelpEngine, onAuthErr)); + CHKiRet(relpEngineSetOnErr(pRelpEngine, onErr)); CHKiRet(relpEngineSetEnableCmd(pRelpEngine, (uchar*) "syslog", eRelpCmdState_Required)); /* tell which objects we need */ |