My Project
Public Member Functions
Log_to_csv_event_handler Class Reference
Inheritance diagram for Log_to_csv_event_handler:

List of all members.

Public Member Functions

virtual bool init ()
virtual void cleanup ()
virtual bool log_slow (THD *thd, time_t current_time, time_t query_start_arg, const char *user_host, uint user_host_len, ulonglong query_utime, ulonglong lock_utime, bool is_command, const char *sql_text, uint sql_text_len)
virtual bool log_error (enum loglevel level, const char *format, va_list args)
virtual bool log_general (THD *thd, time_t event_time, const char *user_host, uint user_host_len, my_thread_id thread_id, const char *command_type, uint command_type_len, const char *sql_text, uint sql_text_len, const CHARSET_INFO *client_cs)
int activate_log (THD *thd, uint log_type)

Member Function Documentation

bool Log_to_csv_event_handler::log_general ( THD *  thd,
time_t  event_time,
const char *  user_host,
uint  user_host_len,
my_thread_id  thread_id,
const char *  command_type,
uint  command_type_len,
const char *  sql_text,
uint  sql_text_len,
const CHARSET_INFO *  client_cs 
) [virtual]

Log command to the general log table

Log given command to the general log table.

event_timecommand start timestamp
user_hostthe pointer to the string with user info
user_host_lenlength of the user_host string. this is computed once and passed to all general log event handlers
thread_idId of the thread, issued a query
command_typethe type of the command being logged
command_type_lenthe length of the string above
sql_textthe very text of the query being executed
sql_text_lenthe length of sql_text string
This function attempts to never call my_error(). This is necessary, because general logging happens already after a statement status has been sent to the client, so the client can not see the error anyway. Besides, the error is not related to the statement being executed and is internal, and thus should be handled internally (
: how?). If a write to the table has failed, the function attempts to write to a short error message to the file. The failure is also indicated in the return value.
Return values:
TRUEerror occured

Implements Log_event_handler.

The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines