gboolean log_extended; /**< log extended information */
gboolean log_systemd; /**< special case for systemd logger */
gboolean log_re_cache; /**< show statistics about regexps */
+ guint log_error_elts; /**< number of elements in error logbuf */
+ guint log_error_elt_maxlen; /**< maximum size of error log element */
gboolean mlock_statfile_pool; /**< use mlock (2) for locking statfiles */
"log_buffer",
rspamd_rcl_parse_struct_integer,
G_STRUCT_OFFSET (struct rspamd_config, log_buf_size),
- 0,
+ RSPAMD_CL_FLAG_INT_32,
"Size of log buffer in bytes (for file logging)");
rspamd_rcl_add_default_handler (sub,
"log_urls",
G_STRUCT_OFFSET (struct rspamd_config, log_encryption_key),
0,
"Encrypt sensitive information in logs using this pubkey");
+ rspamd_rcl_add_default_handler (sub,
+ "error_elts",
+ rspamd_rcl_parse_struct_integer,
+ G_STRUCT_OFFSET (struct rspamd_config, log_error_elts),
+ RSPAMD_CL_FLAG_UINT,
+ "Size of circular buffer for last errors (10 by default)");
+ rspamd_rcl_add_default_handler (sub,
+ "error_maxlen",
+ rspamd_rcl_parse_struct_integer,
+ G_STRUCT_OFFSET (struct rspamd_config, log_error_elt_maxlen),
+ RSPAMD_CL_FLAG_UINT,
+ "Size of each element in error log buffer (1000 by default)");
/**
* Options section
*/
cfg->dns_max_requests = 64;
cfg->history_rows = 200;
+ cfg->log_error_elts = 10;
+ cfg->log_error_elt_maxlen = 1000;
/* Default log line */
cfg->log_format_str = "id: <$mid>,$if_qid{ qid: <$>,}$if_ip{ ip: $,}"