Fix broker log: keep all the pairs together, and the query at the end
@@ -512,13 +512,14 @@ public abstract class BaseBrokerRequestHandler implements BrokerRequestHandler {
LOGGER.debug("Broker Response: {}", brokerResponse);
// Please keep the format as name=value comma-separated with no spaces
- // Please add new entries at the end
+ // Please keep all the name value pairs together, then followed by the query. To add a new entry, please add it to
+ // the end of existing pairs, but before the query.
if (_queryLogRateLimiter.tryAcquire() || forceLog(brokerResponse, totalTimeMs)) {
// Table name might have been changed (with suffix _OFFLINE/_REALTIME appended)
LOGGER.info("requestId={},table={},timeMs={},docs={}/{},entries={}/{},"
+ "segments(queried/processed/matched/consuming/unavailable):{}/{}/{}/{}/{},consumingFreshnessTimeMs={},"
- + "servers={}/{},groupLimitReached={},brokerReduceTimeMs={},exceptions={},serverStats={},query={},"
- + "offlineThreadCpuTimeNs={},realtimeThreadCpuTimeNs={}", requestId,
+ + "servers={}/{},groupLimitReached={},brokerReduceTimeMs={},exceptions={},serverStats={},"
+ + "offlineThreadCpuTimeNs={},realtimeThreadCpuTimeNs={},query={}", requestId,
brokerRequest.getQuerySource().getTableName(), totalTimeMs, brokerResponse.getNumDocsScanned(),
brokerResponse.getTotalDocs(), brokerResponse.getNumEntriesScannedInFilter(),
brokerResponse.getNumEntriesScannedPostFilter(), brokerResponse.getNumSegmentsQueried(),
@@ -527,8 +528,8 @@ public abstract class BaseBrokerRequestHandler implements BrokerRequestHandler {
brokerResponse.getMinConsumingFreshnessTimeMs(), brokerResponse.getNumServersResponded(),
brokerResponse.getNumServersQueried(), brokerResponse.isNumGroupsLimitReached(),
requestStatistics.getReduceTimeMillis(), brokerResponse.getExceptionsSize(), serverStats.getServerStats(),
- StringUtils.substring(query, 0, _queryLogLength), brokerResponse.getOfflineThreadCpuTimeNs(),
- brokerResponse.getRealtimeThreadCpuTimeNs());
+ brokerResponse.getOfflineThreadCpuTimeNs(), brokerResponse.getRealtimeThreadCpuTimeNs(),
+ StringUtils.substring(query, 0, _queryLogLength));
// Limit the dropping log message at most once per second.
if (_numDroppedLogRateLimiter.tryAcquire()) {
