diff options
author | Rainer Gerhards <rgerhards@adiscon.com> | 2013-11-29 15:43:23 +0100 |
---|---|---|
committer | Rainer Gerhards <rgerhards@adiscon.com> | 2013-11-29 15:43:23 +0100 |
commit | 8bf869fafbcc53a134e2842e4fc894ee27ee1c7f (patch) | |
tree | f0b246d3c9d1cc5955fdf70496465a8a52086348 /action.c | |
parent | c3d80cd3b0060a37e15e8e323b5a3535ab1933c0 (diff) | |
download | rsyslog-8bf869fafbcc53a134e2842e4fc894ee27ee1c7f.tar.gz rsyslog-8bf869fafbcc53a134e2842e4fc894ee27ee1c7f.tar.bz2 rsyslog-8bf869fafbcc53a134e2842e4fc894ee27ee1c7f.zip |
actions now report if they suspend and resume themselves
Diffstat (limited to 'action.c')
-rw-r--r-- | action.c | 19 |
1 files changed, 12 insertions, 7 deletions
@@ -180,6 +180,7 @@ configSettings_t cs_save; /* our saved (scope!) config settings */ * counting. -- rgerhards, 2008-01-29 */ static int iActionNbr = 0; +int bActionReportSuspension = 1; /* tables for interfacing with the v6 config system */ static struct cnfparamdescr cnfparamdescr[] = { @@ -645,11 +646,13 @@ actionSuspend(action_t * const pThis) DBGPRINTF("action '%s' suspended, earliest retry=%lld (now %lld), iNbrResRtry %d\n", pThis->pszName, (long long) pThis->ttResumeRtry, (long long) ttNow, pThis->iNbrResRtry); - ctime_r(&pThis->ttResumeRtry, timebuf); - timebuf[strlen(timebuf)-1] = '\0'; /* strip LF */ - errmsg.LogMsg(0, RS_RET_NOT_FOUND, LOG_WARNING, - "action '%s' suspended, next retry is %s", - pThis->pszName, timebuf); + if(bActionReportSuspension) { + ctime_r(&pThis->ttResumeRtry, timebuf); + timebuf[strlen(timebuf)-1] = '\0'; /* strip LF */ + errmsg.LogMsg(0, RS_RET_NOT_FOUND, LOG_WARNING, + "action '%s' suspended, next retry is %s", + pThis->pszName, timebuf); + } } @@ -692,8 +695,10 @@ actionDoRetry(action_t *pThis, int *pbShutdownImmediate) if((iRet == RS_RET_OK) && (!bTreatOKasSusp)) { DBGPRINTF("actionDoRetry: %s had success RDY again (iRet=%d)\n", pThis->pszName, iRet); - errmsg.LogMsg(0, RS_RET_OK, LOG_INFO, "action '%s' resumed", - pThis->pszName); + if(bActionReportSuspension) { + errmsg.LogMsg(0, RS_RET_OK, LOG_INFO, "action '%s' resumed", + pThis->pszName); + } actionSetState(pThis, ACT_STATE_RDY); } else if(iRet == RS_RET_SUSPENDED || bTreatOKasSusp) { /* max retries reached? */ |