18 #ifndef _LOG4CXX_DB_ODBC_APPENDER_H 19 #define _LOG4CXX_DB_ODBC_APPENDER_H 22 #pragma warning ( push ) 23 #pragma warning ( disable: 4231 4251 4275 4786 ) 27 #include <log4cxx/log4cxx.h> 29 #include <log4cxx/helpers/exception.h> 30 #include <log4cxx/appenderskeleton.h> 31 #include <log4cxx/spi/loggingevent.h> 42 void* hInput,
const char* prolog,
47 const char* formatMessage(
short fHandleType,
48 void* hInput,
const char* prolog,
116 typedef void* SQLHDBC;
117 typedef void* SQLHENV;
118 typedef void* SQLHANDLE;
119 typedef short SQLSMALLINT;
155 BEGIN_LOG4CXX_CAST_MAP()
158 END_LOG4CXX_CAST_MAP()
161 virtual ~ODBCAppender();
166 virtual
void setOption(const LogString& option, const LogString& value);
171 virtual
void activateOptions(
log4cxx::helpers::Pool& p);
176 void append(const spi::LoggingEventPtr& event,
log4cxx::helpers::Pool&);
187 LogString getLogStatement(const spi::LoggingEventPtr& event,
188 helpers::Pool& p) const;
198 virtual
void execute(const LogString& sql,
208 virtual
void closeConnection(SQLHDBC con);
216 virtual SQLHDBC getConnection(
log4cxx::helpers::Pool& p) ;
223 virtual
void close();
232 virtual
void flushBuffer(
log4cxx::helpers::Pool& p);
237 virtual
bool requiresLayout()
const 245 void setSql(
const LogString& s);
256 inline void setUser(
const LogString& user)
262 inline void setURL(
const LogString& url)
268 inline void setPassword(
const LogString& password)
270 databasePassword = password;
274 inline void setBufferSize(
size_t newBufferSize)
276 bufferSize = newBufferSize;
279 inline const LogString& getUser()
const 285 inline const LogString& getURL()
const 291 inline const LogString& getPassword()
const 293 return databasePassword;
296 inline size_t getBufferSize()
const 303 #if LOG4CXX_WCHAR_T_API || LOG4CXX_LOGCHAR_IS_WCHAR_T || defined(WIN32) || defined(_WIN32) 304 static void encode(
wchar_t** dest,
const LogString& src,
307 static void encode(
unsigned short** dest,
const LogString& src,
315 #if defined(_MSC_VER) 316 #pragma warning ( pop ) 319 #endif // _LOG4CXX_DB_ODBC_APPENDER_H std::list< spi::LoggingEventPtr > buffer
ArrayList holding the buffer of Logging Events.
Definition: odbcappender.h:151
const LogString & getSql() const
Returns pre-formated statement eg: insert into LogTable (msg) values ("%m")
Definition: odbcappender.h:250
Implementation base class for all appenders.
Definition: appenderskeleton.h:45
Definition: odbcappender.h:38
LogString databaseUser
User to connect as for default connection handling.
Definition: odbcappender.h:109
SQLHDBC connection
Connection used by default.
Definition: odbcappender.h:128
LogString sqlStatement
Stores the string given to the pattern layout for conversion into a SQL statement, eg: insert into LogTable (Thread, File, Message) values ("%t", "%F", "%m")
Definition: odbcappender.h:140
Definition: odbcappender.h:98
LogString databaseURL
URL of the DB for default connection handling.
Definition: odbcappender.h:104
size_t bufferSize
size of LoggingEvent buffer before writing to the database.
Definition: odbcappender.h:146
Definition: appender.h:33
The class Exception and its subclasses indicate conditions that a reasonable application might want t...
Definition: exception.h:37
LogString databasePassword
User to use for default connection handling.
Definition: odbcappender.h:114