matador::sql_logger Class Reference

#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
 

Detailed Description

The sql logger uses the matador logging mechanism with two sink. A rotating file sink besides a stdout sink.

Constructor & Destructor Documentation

◆ sql_logger() [1/2]

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.

◆ sql_logger() [2/2]

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.

Parameters
max_sizeMax file size
file_countMax log file number

Member Function Documentation

◆ on_close()

void matador::sql_logger::on_close ( )
inlineoverridevirtual

No log on disconnect

Implements matador::basic_sql_logger.

◆ on_connect()

void matador::sql_logger::on_connect ( )
inlineoverridevirtual

No log on connect

Implements matador::basic_sql_logger.

◆ on_execute()

void matador::sql_logger::on_execute ( const std::string &  stmt)
overridevirtual

Logs the statement when it is executed

Parameters
stmtStatement to log

Implements matador::basic_sql_logger.

◆ on_prepare()

void matador::sql_logger::on_prepare ( const std::string &  stmt)
overridevirtual

Logs the statement when it is prepared

Parameters
stmtStatement to log

Implements matador::basic_sql_logger.


The documentation for this class was generated from the following file:
  • matador/sql/sql_logger.hpp