#include <sql_logger.hpp>
Inherits matador::basic_sql_logger.
Public Member Functions | |
sql_logger () | |
sql_logger (size_t max_size, size_t file_count) | |
void | on_connect () override |
void | on_close () override |
void | on_execute (const std::string &stmt) override |
void | on_prepare (const std::string &stmt) override |
The sql logger uses the matador logging mechanism with two sink. A rotating file sink besides a stdout sink.
matador::sql_logger::sql_logger | ( | ) |
Creates a sql logger using the matador logging mechanism. Internally a rotating file sink is used. The path is "log/sql.log" with a max file size of 1mb and maximum log file count of 5.
In addition a stdout log sink is used.
matador::sql_logger::sql_logger | ( | size_t | max_size, |
size_t | file_count | ||
) |
Creates a sql logger using the matador logging mechanism. Internally a rotating file sink is used. The path is "log/sql.log" with the given max file size and the given maximum log file count
In addition a stdout log sink is used.
max_size | Max file size |
file_count | Max log file number |
|
inlineoverridevirtual |
No log on disconnect
Implements matador::basic_sql_logger.
|
inlineoverridevirtual |
No log on connect
Implements matador::basic_sql_logger.
|
overridevirtual |
Logs the statement when it is executed
stmt | Statement to log |
Implements matador::basic_sql_logger.
|
overridevirtual |
Logs the statement when it is prepared
stmt | Statement to log |
Implements matador::basic_sql_logger.