@@ -669,17 +669,22 @@ static void qthread(unsigned int num)
669669 }
670670 }
671671
672+ bool logAtNewline{false };
672673 if (PC.enabled () && (question.d .opcode != Opcode::Notify && question.d .opcode != Opcode::Update) && question.couldBeCached ()) {
673674 start = diff;
674675 std::string view{};
675676 if (g_views) {
677+ if (!g_slogStructured) {
678+ g_log << endl;
679+ logAtNewline = true ; // because of getViewFromNetwork below
680+ }
676681 Netmask netmask (accountremote);
677682 view = g_zoneCache.getViewFromNetwork (&netmask);
678683 }
679684 bool haveSomething = PC.get (question, cached, view); // does the PacketCache recognize this question?
680685 if (haveSomething) {
681686 if (g_logDNSQueries) {
682- SLOG (g_log << " : packetcache HIT" << endl,
687+ SLOG (g_log << (logAtNewline ? " " : " : " ) << " packetcache HIT" << endl,
683688 slog->info (Logr::Notice, " packetcache HIT" ));
684689 }
685690 cached.setRemote (&question.d_remote ); // inlined
@@ -707,7 +712,7 @@ static void qthread(unsigned int num)
707712
708713 if (distributor->isOverloaded ()) {
709714 if (g_logDNSQueries) {
710- SLOG (g_log << " : Dropped query, backends are overloaded" << endl,
715+ SLOG (g_log << (logAtNewline ? " " : " : " ) << " Dropped query, backends are overloaded" << endl,
711716 slog->info (Logr::Notice, " Dropped query, backends are overloaded" ));
712717 }
713718 overloadDrops++;
@@ -716,7 +721,7 @@ static void qthread(unsigned int num)
716721
717722 if (g_logDNSQueries) {
718723 if (PC.enabled ()) {
719- SLOG (g_log << " : packetcache MISS" << endl,
724+ SLOG (g_log << (logAtNewline ? " " : " : " ) << " packetcache MISS" << endl,
720725 slog->info (Logr::Notice, " packetcache MISS" ));
721726 }
722727 else {
0 commit comments