18#ifndef _LOG4CXX_DB_ODBC_APPENDER_H
19#define _LOG4CXX_DB_ODBC_APPENDER_H
21#include <log4cxx/log4cxx.h>
27#if LOG4CXX_EVENTS_AT_EXIT
28#include <log4cxx/private/atexitregistry.h>
38class LOG4CXX_EXPORT
SQLException :
public LOG4CXX_NS::helpers::Exception
42 void* hInput,
const char* prolog,
43 LOG4CXX_NS::helpers::Pool& p);
47 const char* formatMessage(
short fHandleType,
48 void* hInput,
const char* prolog,
49 LOG4CXX_NS::helpers::Pool& p);
201 LOG4CXX_NS::
helpers::Pool& p) ;
270#if LOG4CXX_WCHAR_T_API || LOG4CXX_LOGCHAR_IS_WCHAR_T || defined(WIN32) || defined(_WIN32)
271 static void encode(
wchar_t** dest,
const LogString& src,
272 LOG4CXX_NS::helpers::Pool& p);
274 static void encode(
unsigned short** dest,
const LogString& src,
275 LOG4CXX_NS::helpers::Pool& p);
278 struct ODBCAppenderPriv;
AppenderSkeleton(LOG4CXX_PRIVATE_PTR(AppenderSkeletonPrivate) priv)
The ODBCAppender sends log events to a database.
Definition odbcappender.h:143
virtual SQLHDBC getConnection(log4cxx::helpers::Pool &p)
Override this to link with your connection pooling system.
virtual void flushBuffer(log4cxx::helpers::Pool &p)
loops through the buffer of LoggingEvents, gets a sql string from getLogStatement() and sends it to e...
bool requiresLayout() const override
Does this appender require a layout?
virtual void closeConnection(SQLHDBC con)
Override this to return the connection to a pool, or to clean up the resource.
void activateOptions(helpers::Pool &p) override
Activate the specified options.
void * SQLHENV
Definition odbcappender.h:152
const LogString & getUser() const
void setBufferSize(size_t newBufferSize)
void setUser(const LogString &user)
LogString getLogStatement(const spi::LoggingEventPtr &event, helpers::Pool &p) const
To be removed.
const LogString & getSql() const
Returns pre-formated statement eg: insert into LogTable (msg) values ("%m")
void setPassword(const LogString &password)
const LogString & getPassword() const
void setURL(const LogString &url)
void * SQLHDBC
Definition odbcappender.h:151
void setOption(const LogString &option, const LogString &value) override
Set option to value.
void * SQLHANDLE
Definition odbcappender.h:153
void append(const spi::LoggingEventPtr &event, helpers::Pool &) override
Adds the event to the buffer.
void close() override
Closes the appender, flushing the buffer first then closing the default connection if it is open.
virtual void execute(const LogString &sql, log4cxx::helpers::Pool &p)
To be removed.
void setSql(const LogString &s)
Set pre-formated statement eg: insert into LogTable (msg) values ("%m")
const LogString & getURL() const
short SQLSMALLINT
Definition odbcappender.h:154
size_t getBufferSize() const
SQLException(const char *msg)
SQLException(const SQLException &src)
SQLException(short fHandleType, void *hInput, const char *prolog, log4cxx::helpers::Pool &p)
LOG4CXX_PTR_DEF(DBAppender)
Definition propertysetter.h:27
std::basic_string< logchar > LogString
Definition logstring.h:60
#define LOG4CXX_CAST_ENTRY(Interface)
Definition object.h:158
#define END_LOG4CXX_CAST_MAP()
Definition object.h:152
#define DECLARE_LOG4CXX_OBJECT(object)
Definition object.h:43
#define LOG4CXX_CAST_ENTRY_CHAIN(Interface)
Definition object.h:164
#define BEGIN_LOG4CXX_CAST_MAP()
Definition object.h:146