@@ -265,11 +265,42 @@ int InfoLoggerDispatchSQLImpl::customLoop()
265265int InfoLoggerDispatchSQLImpl::customMessageProcess (std::shared_ptr<InfoLoggerMessageList> lmsg)
266266{
267267 // procedure for dropped messages and keep count of them
268- auto returnDroppedMessage = [&](const char * message) {
268+ auto returnDroppedMessage = [&](const char * message, infoLog_msg_t* m ) {
269269 // log bad message content (truncated)
270270 const int maxLen = 200 ;
271+
272+ // verbose logging of the other fields
273+ std::string logDetails;
274+ for (int i = 0 ; i < nFields - 1 ; i++) {
275+ logDetails += protocols[0 ].fields [i].name ;
276+ logDetails += " =" ;
277+ if (!m->values [i].isUndefined ) {
278+ switch (protocols[0 ].fields [i].type ) {
279+ case infoLog_msgField_def_t::ILOG_TYPE_STRING:
280+ if (m->values [i].value .vString != nullptr ) {
281+ std::string ss = m->values [i].value .vString ;
282+ logDetails += ss.substr (0 ,maxLen);
283+ if (ss.length () > maxLen) {
284+ logDetails += " ..." ;
285+ }
286+ }
287+ break ;
288+ case infoLog_msgField_def_t::ILOG_TYPE_INT:
289+ logDetails += std::to_string (m->values [i].value .vInt );
290+ break ;
291+ case infoLog_msgField_def_t::ILOG_TYPE_DOUBLE:
292+ logDetails += std::to_string (m->values [i].value .vDouble );
293+ break ;
294+ default :
295+ break ;
296+ }
297+ }
298+ logDetails += " " ;
299+ }
300+
271301 int msgLen = (int )strlen (message);
272302 theLog->error (" Dropping message (%d bytes): %.*s%s" , msgLen, maxLen, message, (msgLen > maxLen) ? " ..." : " " );
303+ theLog->error (" %s" , logDetails.c_str ());
273304 msgDroppedCount++;
274305 return 0 ; // remove message from queue
275306 };
@@ -347,15 +378,15 @@ int InfoLoggerDispatchSQLImpl::customMessageProcess(std::shared_ptr<InfoLoggerMe
347378 theLog->error (" mysql_stmt_bind() failed: %s" , mysql_error (db));
348379 theLog->error (" message: %s" , msg);
349380 // if can not bind, message malformed, drop it
350- return returnDroppedMessage (msg);
381+ return returnDroppedMessage (msg, m );
351382 }
352383
353384 // Do the insertion
354385 if (mysql_stmt_execute (stmt)) {
355386 theLog->error (" mysql_stmt_exec() failed: (%d) %s" , mysql_errno (db), mysql_error (db));
356387 // column too long
357388 if (mysql_errno (db) == ER_DATA_TOO_LONG) {
358- return returnDroppedMessage (msg);
389+ return returnDroppedMessage (msg, m );
359390 }
360391 // retry with new connection - usually it means server was down
361392 disconnectDB ();
0 commit comments