in_syslog: add more verbosity when failed to parse log message
This patch makes the warning message [ warn] [in_syslog] error parsing log
message more detailed by showing alias name of input plugin and parser
name. It also prints the content of the message not parsed in debug mode.
@@ -104,7 +104,10 @@ int syslog_prot_process(struct syslog_conn *conn)
flb_free(out_buf);
}
else {
- flb_warn("[in_syslog] error parsing log message");
+ flb_warn("[in_syslog] error parsing log message "
+ "on \"%s\" with parser '%s')",
+ flb_input_name(ctx->i_ins), ctx->parser->name);
+ flb_debug("[in_syslog] unparsed log message: %.*s", len, p);
}
conn->buf_parsed += len + 1;
@@ -139,7 +142,10 @@ int syslog_prot_process_udp(char *buf, size_t size, struct flb_syslog *ctx)
flb_free(out_buf);
}
else {
- flb_warn("[in_syslog] error parsing log message");
+ flb_warn("[in_syslog] error parsing log message "
+ "on \"%s\" with parser '%s')",
+ flb_input_name(ctx->i_ins), ctx->parser->name);
+ flb_debug("[in_syslog] unparsed log message: %.*s", size, buf);
return -1;
}
