diff options
author | Rainer Gerhards <rgerhards@adiscon.com> | 2008-12-19 12:52:49 +0100 |
---|---|---|
committer | Rainer Gerhards <rgerhards@adiscon.com> | 2008-12-19 12:52:49 +0100 |
commit | a185665be4cf699752589d81ef6e396dd61f68b6 (patch) | |
tree | 3ab55776b57ff487c1ee264465f304b3b9fe9e30 /action.c | |
parent | 246962be65941c7994aa18e4f9327f239c62eb9e (diff) | |
download | rsyslog-a185665be4cf699752589d81ef6e396dd61f68b6.tar.gz rsyslog-a185665be4cf699752589d81ef6e396dd61f68b6.tar.xz rsyslog-a185665be4cf699752589d81ef6e396dd61f68b6.zip |
experimentally altered "last message repeated n times" to include msg
This was suggested by David Lang, to help identify the message that was
repeated. A problem is that I do not have the expanded template at
hand when the "last ... times" message is generated. Spending much time
on this functionality is also probably not a good thing, as the whole
functionality will be overhauled (and once this is done we will not at
all have the output template at hand). So the approach is to use a single
field - here msg - and inlcude it as a notation of what was repeated. This
is far from being perfect, but eventually good enough. I will now wait
for feedback before going any further.
Diffstat (limited to 'action.c')
-rw-r--r-- | action.c | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -621,9 +621,15 @@ actionWriteToAction(action_t *pAction) */ if(pAction->f_prevcount > 1) { msg_t *pMsg; +#if 0 /* old */ uchar szRepMsg[64]; snprintf((char*)szRepMsg, sizeof(szRepMsg), "last message repeated %d times", pAction->f_prevcount); +#else + uchar szRepMsg[1024]; + snprintf((char*)szRepMsg, sizeof(szRepMsg), "message repeated %d times: [%.800]", + pAction->f_prevcount, getMSG(pAction->f_pMsg)); +#endif if((pMsg = MsgDup(pAction->f_pMsg)) == NULL) { /* it failed - nothing we can do against it... */ @@ -658,12 +664,11 @@ actionWriteToAction(action_t *pAction) dbgprintf("action not yet ready again to be executed, onceInterval %d, tCurr %d, tNext %d\n", (int) pAction->iSecsExecOnceInterval, (int) getActNow(pAction), (int) (pAction->iSecsExecOnceInterval + pAction->tLastExec)); - /* TODO: the time call below may use reception time, not dequeue time - under consideration. -- rgerhards, 2008-09-17 */ pAction->tLastExec = getActNow(pAction); /* re-init time flags */ FINALIZE; } - /* TODO: the time call below may use reception time, not dequeue time - under consideration. -- rgerhards, 2008-09-17 */ + /* we use reception time, not dequeue time - this is considered more appropriate and also faster ;) -- rgerhards, 2008-09-17 */ pAction->f_time = pAction->f_pMsg->ttGenTime; /* When we reach this point, we have a valid, non-disabled action. |