extern THREAD_LOCAL char *logline;
extern THREAD_LOCAL char *logline_rfc5424;
+/* global syslog message counter */
+extern int cum_log_messages;
+
/* syslog UDP message handler */
void syslog_fd_handler(int fd);
}
struct ist *build_log_header(enum log_fmt format, int level, int facility, struct ist *metadata, size_t *nbelem);
+
#endif /* _HAPROXY_LOG_H */
/*
INF_TOTAL_SPLICED_BYTES_OUT,
INF_BYTES_OUT_RATE,
INF_DEBUG_COMMANDS_ISSUED,
+ INF_CUM_LOG_MSGS,
/* must always be the last one */
INF_TOTAL_FIELDS
#include <haproxy/tools.h>
#include <haproxy/version.h>
+/* global recv logs counter */
+int cum_log_messages;
/* log forward proxy list */
struct proxy *cfg_log_forward;
}
buf->data = ret;
+ /* update counters */
+ _HA_ATOMIC_ADD(&cum_log_messages, 1);
+ proxy_inc_fe_conn_ctr(l, l->bind_conf->frontend);
+
parse_log_message(buf->area, buf->data, &level, &facility, metadata, &message, &size);
process_send_log(&l->bind_conf->frontend->logsrvs, level, facility, metadata, message, size);
[INF_TOTAL_SPLICED_BYTES_OUT] = { .name = "TotalSplicdedBytesOut", .desc = "Total number of bytes emitted by current worker process through a kernel pipe since started" },
[INF_BYTES_OUT_RATE] = { .name = "BytesOutRate", .desc = "Number of bytes emitted by current worker process over the last second" },
[INF_DEBUG_COMMANDS_ISSUED] = { .name = "DebugCommandsIssued", .desc = "Number of debug commands issued on this process (anything > 0 is unsafe)" },
+ [INF_CUM_LOG_MSGS] = { .name = "CumRecvLogs", .desc = "Total number of log messages received by log-forwarding listeners on this worker process since started" },
};
const struct name_desc stat_fields[ST_F_TOTAL_FIELDS] = {
info[INF_TOTAL_SPLICED_BYTES_OUT] = mkf_u64(0, global.spliced_out_bytes);
info[INF_BYTES_OUT_RATE] = mkf_u64(FN_RATE, (unsigned long long)read_freq_ctr(&global.out_32bps) * 32);
info[INF_DEBUG_COMMANDS_ISSUED] = mkf_u32(0, debug_commands_issued);
+ info[INF_CUM_LOG_MSGS] = mkf_u32(FN_COUNTER, cum_log_messages);
return 1;
}