RFC 3164 compliant remote logging
[project/ubox.git] / log / logread.c
index 28c9462904e69e07ae1649fa6ae9658567d320b6..a7ab567a9fa0bbd0f6c4b8072f7e35b9128d332c 100644 (file)
@@ -135,9 +135,12 @@ static int log_notify(struct blob_attr *msg)
        if (log_type == LOG_NET) {
                int err;
 
-               *buf = '\0';
-               if (hostname)
-                       snprintf(buf, sizeof(buf), "%s ", hostname);
+               snprintf(buf, sizeof(buf), "<%u>", p);
+               strncat(buf, c + 4, 16);
+               if (hostname) {
+                       strncat(buf, hostname, sizeof(buf));
+                       strncat(buf, " ", sizeof(buf));
+               }
                if (log_prefix) {
                        strncat(buf, log_prefix, sizeof(buf));
                        strncat(buf, ": ", sizeof(buf));