New feature: write header message at start of logging (both file and socket) or file flush. Includes configuration parameter: audit_header_msg to control if header message enabled/disabled (default enabled).

This commit is contained in:
Guy Lichtman
2014-06-11 10:49:56 +03:00
parent a935dc105a
commit d3eddd6cf7
3 changed files with 53 additions and 2 deletions

View File

@@ -12,6 +12,7 @@
#include <yajl/yajl_gen.h>
#define AUDIT_LOG_PREFIX "Audit Plugin:"
#define AUDIT_PROTOCOL_VERSION "1.0"
class THD;
@@ -267,13 +268,20 @@ public:
static const char * DEF_MSG_DELIMITER;
Audit_json_formatter(): m_msg_delimiter(NULL)
Audit_json_formatter(): m_msg_delimiter(NULL), m_write_start_msg(true)
{
config.beautify = 0;
config.indentString = NULL;
}
virtual ~Audit_json_formatter() {}
virtual ssize_t event_format(ThdSesData *pThdData, IWriter * writer);
virtual ssize_t start_msg_format(IWriter * writer);
/**
* Boolean indicating if to log start msg.
* Public so sysvar can update.
*/
my_bool m_write_start_msg;
/**
* Message delimiter. Should point to a valid json string (supporting the json escapping format).