Kea 2.7.5
db_log.h File Reference

We want to reuse the database backend connection and exchange code for other uses, in particular for hook libraries. More...

#include <log/macros.h>
#include <map>
#include <mutex>
#include <list>
+ Include dependency graph for db_log.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  isc::db::DB_LOG< log_type >
 DB_LOG_* logic. More...
 
struct  isc::db::DB_LOG_DEBUG
 
struct  isc::db::DB_LOG_ERROR
 
struct  isc::db::DB_LOG_FATAL
 all DB_LOG specializations More...
 
struct  isc::db::DB_LOG_INFO
 
struct  isc::db::DB_LOG_WARN
 
class  isc::db::DbLogger
 Database logger class. More...
 

Namespaces

namespace  isc
 Defines the logger used by the top-level component of kea-lfc.
 
namespace  isc::db
 

Typedefs

typedef std::list< DbLoggerisc::db::DbLoggerStack
 Database logger stack.
 

Enumerations

enum  isc::db::log_type_t {
  isc::db::fatal , isc::db::error , isc::db::warn , isc::db::info ,
  isc::db::debug
}
 log type enumerations for use in DB_LOG specializations More...
 
enum  isc::db::DbMessageID {
  isc::db::DB_INVALID_ACCESS , isc::db::PGSQL_INITIALIZE_SCHEMA , isc::db::PGSQL_DEALLOC_ERROR , isc::db::PGSQL_FATAL_ERROR ,
  isc::db::PGSQL_START_TRANSACTION , isc::db::PGSQL_COMMIT , isc::db::PGSQL_ROLLBACK , isc::db::PGSQL_CREATE_SAVEPOINT ,
  isc::db::PGSQL_ROLLBACK_SAVEPOINT , isc::db::PGSQL_TCP_USER_TIMEOUT_UNSUPPORTED , isc::db::MYSQL_INITIALIZE_SCHEMA , isc::db::MYSQL_FATAL_ERROR ,
  isc::db::MYSQL_START_TRANSACTION , isc::db::MYSQL_COMMIT , isc::db::MYSQL_ROLLBACK
}
 Database messages. More...
 

Functions

void isc::db::checkDbLoggerStack ()
 Check database logger stack.
 

Detailed Description

We want to reuse the database backend connection and exchange code for other uses, in particular for hook libraries.

But this code includes some calls to the system logger for debug and uncommon cases and of course we do not want to get log messages from a hook library to seem to come from DHCP server core.

The solution is to use a database logger which calls the right logger with mapped messages.

Definition in file db_log.h.