17 #ifndef _LOG4CXX_UCM_APPENDER_H
18 #define _LOG4CXX_UCM_APPENDER_H
22 #include <log4cxx/helpers/exception.h>
23 #include <log4cxx/appenderskeleton.h>
24 #include <log4cxx/spi/loggingevent.h>
35 #if REDUNDANT_EXCEPTION
36 class LOG4CXX_EXPORT UCMException :
public helpers::Exception
39 UCMException(
int code) : code(code) {}
40 virtual String getMessage() {
return String(); }
47 #if (STAR_LOG4CXX_VERSION != 10)
48 typedef helpers::ObjectPtrT<StUCMAppender> StUCMAppenderPtr;
96 class LOG4CXX_EXPORT StUCMAppender :
public AppenderSkeleton
112 String databasePassword;
147 std::list<spi::LoggingEventPtr> buffer;
148 unsigned long fLastId;
149 bool fIsConnectionOpen;
150 #if (STAR_LOG4CXX_VERSION == 10)
152 virtual void append(
const spi::LoggingEventPtr& event, log4cxx::helpers::Pool& p);
156 DECLARE_LOG4CXX_OBJECT(StUCMAppender)
157 BEGIN_LOG4CXX_CAST_MAP()
158 LOG4CXX_CAST_ENTRY(StUCMAppender)
159 LOG4CXX_CAST_ENTRY_CHAIN(AppenderSkeleton)
160 END_LOG4CXX_CAST_MAP()
162 StUCMAppender(const
char *mode="F");
163 virtual ~StUCMAppender();
168 virtual
void setOption(const String& option, const String& value);
173 void append(const spi::LoggingEventPtr& event);
184 String getLogStatement(const spi::LoggingEventPtr& event);
194 virtual
void closeConnection();
202 virtual TxLogging::TxEventLog *getConnection() ;
209 virtual
void close();
238 virtual
bool requiresLayout()
const
241 inline void setUser(
const String& user)
242 { databaseUser = user; }
245 inline void setURL(
const String& url)
246 { databaseURL = url; }
249 inline void setPassword(
const String& password)
250 { databasePassword = password; }
253 inline void setBufferSize(
size_t newBufferSize)
254 { bufferSize = newBufferSize; }
256 inline const String& getUser()
const
257 {
return databaseUser; }
260 inline const String& getURL()
const
261 {
return databaseURL; }
264 inline const String& getPassword()
const
265 {
return databasePassword; }
267 inline size_t getBufferSize()
const
268 {
return bufferSize; }
270 #if (STAR_LOG4CXX_VERSION == 10)
271 LOG4CXX_PTR_DEF(StUCMAppender);
276 #endif // _LOG4CXX_UCM_APPENDER_H