1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

MDEV-15 Log all SQL errors.

Added the logger service that provides us with the rotating logs.
              The plugin SQL_ERROR_LOG added. It logs the errors using the 'logger service'
                      for the rotating log files.
              the example record from the log:
                2012-03-09 15:07:29 root[root] @ localhost [] ERROR 1146: Table 'test.xyz' doesn't exist : select * from test.xyz
This commit is contained in:
Alexey Botchkov
2012-03-14 00:55:56 +04:00
parent 92f31d8070
commit 07a82c58a7
17 changed files with 543 additions and 4 deletions

View File

@ -80,6 +80,24 @@ void thd_progress_next_stage(void* thd);
void thd_progress_end(void* thd);
const char *set_thd_proc_info(void*, const char * info, const char *func,
const char *file, unsigned int line);
#include <mysql/service_logger.h>
typedef struct logger_handle_st LOGGER_HANDLE;
extern struct logger_service_st {
LOGGER_HANDLE* (*open)(const char *path,
unsigned long size_limit,
unsigned int rotations);
int (*close)(LOGGER_HANDLE *log);
int (*vprintf)(LOGGER_HANDLE *log, const char *fmt, va_list argptr);
int (*printf)(LOGGER_HANDLE *log, const char *fmt, ...);
int (*rotate)(LOGGER_HANDLE *log);
} *logger_service;
LOGGER_HANDLE *logger_open(const char *path,
unsigned long size_limit,
unsigned int rotations);
int logger_close(LOGGER_HANDLE *log);
int logger_vprintf(LOGGER_HANDLE *log, const char *fmt, va_list argptr);
int logger_rotate(LOGGER_HANDLE *log);
int logger_printf(LOGGER_HANDLE *log, const char *fmt, ...);
struct st_mysql_xid {
long formatID;
long gtrid_length;