1ff636
From c546fffcff0d2e3522738aac30391d5996bdf4a6 Mon Sep 17 00:00:00 2001
1ff636
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
1ff636
Date: Thu, 12 Mar 2015 21:29:28 -0400
1ff636
Subject: [PATCH] journal-remote: downgrade routine messages to debug
1ff636
1ff636
https://bugs.freedesktop.org/show_bug.cgi?id=89486
1ff636
(cherry picked from commit 0e72da6fe8671d49b4d458519f5ac7600fd04f03)
1ff636
---
1ff636
 src/journal-remote/journal-remote-parse.c |  2 +-
1ff636
 src/journal-remote/journal-remote-write.c |  2 +-
23b3cf
 src/journal-remote/journal-remote.c       | 36 +++++++++++------------
23b3cf
 src/journal-remote/microhttpd-util.c      |  4 +--
1ff636
 4 files changed, 22 insertions(+), 22 deletions(-)
1ff636
1ff636
diff --git a/src/journal-remote/journal-remote-parse.c b/src/journal-remote/journal-remote-parse.c
181b3f
index afded7e38..6c096de03 100644
1ff636
--- a/src/journal-remote/journal-remote-parse.c
1ff636
+++ b/src/journal-remote/journal-remote-parse.c
1ff636
@@ -443,7 +443,7 @@ int process_source(RemoteSource *source, bool compress, bool seal) {
1ff636
                 return r;
1ff636
 
1ff636
         /* We have a full event */
1ff636
-        log_trace("Received a full event from source@%p fd:%d (%s)",
1ff636
+        log_trace("Received full event from source@%p fd:%d (%s)",
1ff636
                   source, source->fd, source->name);
1ff636
 
1ff636
         if (!source->iovw.count) {
1ff636
diff --git a/src/journal-remote/journal-remote-write.c b/src/journal-remote/journal-remote-write.c
181b3f
index df3004939..99820fa7b 100644
1ff636
--- a/src/journal-remote/journal-remote-write.c
1ff636
+++ b/src/journal-remote/journal-remote-write.c
1ff636
@@ -156,7 +156,7 @@ int writer_write(Writer *w,
1ff636
         if (r < 0)
1ff636
                 return r;
1ff636
         else
1ff636
-                log_info("%s: Successfully rotated journal", w->journal->path);
1ff636
+                log_debug("%s: Successfully rotated journal", w->journal->path);
1ff636
 
1ff636
         log_debug("Retrying write.");
1ff636
         r = journal_file_append_entry(w->journal, ts, iovw->iovec, iovw->count,
1ff636
diff --git a/src/journal-remote/journal-remote.c b/src/journal-remote/journal-remote.c
181b3f
index 8f32a9a98..d1486e7cd 100644
1ff636
--- a/src/journal-remote/journal-remote.c
1ff636
+++ b/src/journal-remote/journal-remote.c
1ff636
@@ -207,7 +207,7 @@ static int open_output(Writer *w, const char* host) {
1ff636
                 log_error_errno(r, "Failed to open output journal %s: %m",
1ff636
                                 output);
1ff636
         else
1ff636
-                log_info("Opened output file %s", w->journal->path);
1ff636
+                log_debug("Opened output file %s", w->journal->path);
1ff636
         return r;
1ff636
 }
1ff636
 
1ff636
@@ -747,7 +747,7 @@ static int setup_microhttpd_socket(RemoteServer *s,
1ff636
                                    const char *trust) {
1ff636
         int fd;
1ff636
 
1ff636
-        fd = make_socket_fd(LOG_INFO, address, SOCK_STREAM | SOCK_CLOEXEC);
1ff636
+        fd = make_socket_fd(LOG_DEBUG, address, SOCK_STREAM | SOCK_CLOEXEC);
1ff636
         if (fd < 0)
1ff636
                 return fd;
1ff636
 
1ff636
@@ -844,7 +844,7 @@ static int remoteserver_init(RemoteServer *s,
1ff636
         if (n < 0)
1ff636
                 return log_error_errno(n, "Failed to read listening file descriptors from environment: %m");
1ff636
         else
1ff636
-                log_info("Received %d descriptors", n);
1ff636
+                log_debug("Received %d descriptors", n);
1ff636
 
1ff636
         if (MAX(http_socket, https_socket) >= SD_LISTEN_FDS_START + n) {
1ff636
                 log_error("Received fewer sockets than expected");
1ff636
@@ -853,7 +853,7 @@ static int remoteserver_init(RemoteServer *s,
1ff636
 
1ff636
         for (fd = SD_LISTEN_FDS_START; fd < SD_LISTEN_FDS_START + n; fd++) {
1ff636
                 if (sd_is_socket(fd, AF_UNSPEC, 0, true)) {
1ff636
-                        log_info("Received a listening socket (fd:%d)", fd);
1ff636
+                        log_debug("Received a listening socket (fd:%d)", fd);
1ff636
 
1ff636
                         if (fd == http_socket)
1ff636
                                 r = setup_microhttpd_server(s, fd, NULL, NULL, NULL);
1ff636
@@ -868,7 +868,7 @@ static int remoteserver_init(RemoteServer *s,
1ff636
                         if (r < 0)
1ff636
                                 return log_error_errno(r, "Failed to retrieve remote name: %m");
1ff636
 
1ff636
-                        log_info("Received a connection socket (fd:%d) from %s", fd, hostname);
1ff636
+                        log_debug("Received a connection socket (fd:%d) from %s", fd, hostname);
1ff636
 
1ff636
                         r = add_source(s, fd, hostname, true);
1ff636
                 } else {
1ff636
@@ -908,7 +908,7 @@ static int remoteserver_init(RemoteServer *s,
1ff636
         }
1ff636
 
1ff636
         if (arg_listen_raw) {
1ff636
-                log_info("Listening on a socket...");
1ff636
+                log_debug("Listening on a socket...");
1ff636
                 r = setup_raw_socket(s, arg_listen_raw);
1ff636
                 if (r < 0)
1ff636
                         return r;
1ff636
@@ -930,12 +930,12 @@ static int remoteserver_init(RemoteServer *s,
1ff636
                 const char *output_name;
1ff636
 
1ff636
                 if (streq(*file, "-")) {
1ff636
-                        log_info("Using standard input as source.");
1ff636
+                        log_debug("Using standard input as source.");
1ff636
 
1ff636
                         fd = STDIN_FILENO;
1ff636
                         output_name = "stdin";
1ff636
                 } else {
1ff636
-                        log_info("Reading file %s...", *file);
1ff636
+                        log_debug("Reading file %s...", *file);
1ff636
 
1ff636
                         fd = open(*file, O_RDONLY|O_CLOEXEC|O_NOCTTY|O_NONBLOCK);
1ff636
                         if (fd < 0)
1ff636
@@ -1014,22 +1014,22 @@ static int dispatch_raw_source_event(sd_event_source *event,
1ff636
         if (source->state == STATE_EOF) {
1ff636
                 size_t remaining;
1ff636
 
1ff636
-                log_info("EOF reached with source fd:%d (%s)",
1ff636
-                         source->fd, source->name);
1ff636
+                log_debug("EOF reached with source fd:%d (%s)",
1ff636
+                          source->fd, source->name);
1ff636
 
1ff636
                 remaining = source_non_empty(source);
1ff636
                 if (remaining > 0)
1ff636
-                        log_warning("Premature EOF. %zu bytes lost.", remaining);
1ff636
+                        log_notice("Premature EOF. %zu bytes lost.", remaining);
1ff636
                 remove_source(s, source->fd);
1ff636
-                log_info("%zu active sources remaining", s->active);
1ff636
+                log_debug("%zu active sources remaining", s->active);
1ff636
                 return 0;
1ff636
         } else if (r == -E2BIG) {
1ff636
-                log_error("Entry too big, skipped");
1ff636
+                log_notice_errno(E2BIG, "Entry too big, skipped");
1ff636
                 return 1;
1ff636
         } else if (r == -EAGAIN) {
1ff636
                 return 0;
1ff636
         } else if (r < 0) {
1ff636
-                log_info_errno(r, "Closing connection: %m");
1ff636
+                log_debug_errno(r, "Closing connection: %m");
1ff636
                 remove_source(server, fd);
1ff636
                 return 0;
1ff636
         } else
1ff636
@@ -1071,10 +1071,10 @@ static int accept_connection(const char* type, int fd,
1ff636
                         return r;
1ff636
                 }
1ff636
 
1ff636
-                log_info("Accepted %s %s connection from %s",
1ff636
-                         type,
1ff636
-                         socket_address_family(addr) == AF_INET ? "IP" : "IPv6",
1ff636
-                         a);
1ff636
+                log_debug("Accepted %s %s connection from %s",
1ff636
+                          type,
1ff636
+                          socket_address_family(addr) == AF_INET ? "IP" : "IPv6",
1ff636
+                          a);
1ff636
 
1ff636
                 *hostname = b;
1ff636
 
1ff636
diff --git a/src/journal-remote/microhttpd-util.c b/src/journal-remote/microhttpd-util.c
181b3f
index a95fff18f..b45c38d68 100644
1ff636
--- a/src/journal-remote/microhttpd-util.c
1ff636
+++ b/src/journal-remote/microhttpd-util.c
1ff636
@@ -178,7 +178,7 @@ static int verify_cert_authorized(gnutls_session_t session) {
1ff636
         if (r < 0)
1ff636
                 return log_error_errno(r, "gnutls_certificate_verification_status_print failed: %m");
1ff636
 
1ff636
-        log_info("Certificate status: %s", out.data);
1ff636
+        log_debug("Certificate status: %s", out.data);
1ff636
         gnutls_free(out.data);
1ff636
 
1ff636
         return status == 0 ? 0 : -EPERM;
1ff636
@@ -280,7 +280,7 @@ int check_permissions(struct MHD_Connection *connection, int *code, char **hostn
1ff636
                 return -EPERM;
1ff636
         }
1ff636
 
1ff636
-        log_info("Connection from %s", buf);
1ff636
+        log_debug("Connection from %s", buf);
1ff636
 
1ff636
         if (hostname) {
1ff636
                 *hostname = buf;