When logread daemon send a syslog message to another host, time, severity and facility are cut off.
The message contains only text. This patch adds time, severity and facility in the message as described in the RFC 3164.
Signed-off-by: Belkov Max <belkov-max@mail.ru>
if (log_type == LOG_NET) {
int err;
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));
if (log_prefix) {
strncat(buf, log_prefix, sizeof(buf));
strncat(buf, ": ", sizeof(buf));