Reduce verbosity of log files when using JSON protocol.
This commit is contained in:
20
protocol.c
20
protocol.c
@ -489,9 +489,12 @@ int SCWriteSycamore(SConnection * pCon, char *pBuffer, int iOut)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
snprintf(pBueffel,sizeof(pBueffel)-1, "Next line intended for socket: %d", pCon->sockHandle);
|
iRet=snprintf(pBueffel,sizeof(pBueffel)-1, "[%d]:%s", pCon->sockHandle, pBuffer);
|
||||||
SICSLogWrite(pBueffel, eInternal);
|
SICSLogWrite(pBueffel, iOut);
|
||||||
SICSLogWrite(pBuffer, iOut);
|
if (iRet >= MAXMSG) {
|
||||||
|
snprintf(pBueffel,sizeof(pBueffel)-1, "TRUNCATED MESSAGE: message len=%d, MAXMSG=%d",strlen(pBuffer), MAXMSG);
|
||||||
|
SICSLogWrite(pBueffel, eError);
|
||||||
|
}
|
||||||
|
|
||||||
/* write to commandlog if user or manager privilege */
|
/* write to commandlog if user or manager privilege */
|
||||||
if (SCGetRights(pCon) <= usUser) {
|
if (SCGetRights(pCon) <= usUser) {
|
||||||
@ -683,10 +686,13 @@ int SCWriteJSON_String(SConnection * pCon, char *pBuffer, int iOut)
|
|||||||
if (strlen(pBuffer) == 0)
|
if (strlen(pBuffer) == 0)
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
if (pCon->iMacro != 1) {
|
if (!SCinMacro(pCon)) {
|
||||||
snprintf(pBueffel,sizeof(pBueffel)-1, "Next line intended for socket: %d", pCon->sockHandle);
|
iRet=snprintf(pBueffel,sizeof(pBueffel)-1, "[%d]:%s", pCon->sockHandle, pBuffer);
|
||||||
SICSLogWrite(pBueffel, eInternal);
|
SICSLogWrite(pBueffel, iOut);
|
||||||
SICSLogWrite(pBuffer, iOut);
|
if (iRet >= MAXMSG) {
|
||||||
|
snprintf(pBueffel,sizeof(pBueffel)-1, "TRUNCATED MESSAGE: message len=%d, MAXMSG=%d",strlen(pBuffer), MAXMSG);
|
||||||
|
SICSLogWrite(pBueffel, eError);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* write to commandlog if user or manager privilege */
|
/* write to commandlog if user or manager privilege */
|
||||||
|
Reference in New Issue
Block a user