18 #ifndef _LOG4CXX_ASYNC_APPENDER_H 19 #define _LOG4CXX_ASYNC_APPENDER_H 22 #pragma warning ( push ) 23 #pragma warning ( disable: 4231 4251 4275 4786 ) 32 #include <condition_variable> 34 #if defined(NON_BLOCKING) 35 #include <boost/lockfree/queue.hpp> 101 AppenderList getAllAppenders()
const;
117 bool getLocationInfo()
const;
125 virtual bool requiresLayout()
const;
130 void removeAllAppenders();
141 void removeAppender(
const LogString& name);
148 void setLocationInfo(
bool flag);
155 void setBufferSize(
int size);
161 int getBufferSize()
const;
169 void setBlocking(
bool value);
178 bool getBlocking()
const;
195 enum { DEFAULT_BUFFER_SIZE = 128 };
200 #if defined(NON_BLOCKING) 201 boost::lockfree::queue<log4cxx::spi::LoggingEvent* > buffer;
202 std::atomic<size_t> discardedCount;
204 LoggingEventList buffer;
210 std::mutex bufferMutex;
212 #if defined(NON_BLOCKING) 213 ::log4cxx::helpers::Semaphore bufferNotFull;
214 ::log4cxx::helpers::Semaphore bufferNotEmpty;
216 std::condition_variable bufferNotFull;
217 std::condition_variable bufferNotEmpty;
240 DiscardSummary(
const DiscardSummary& src);
242 DiscardSummary& operator=(
const DiscardSummary& src);
260 size_t discardedCount);
266 typedef std::map<LogString, DiscardSummary> DiscardMap;
267 DiscardMap* discardMap;
277 helpers::AppenderAttachableImplPtr appenders;
282 std::thread dispatcher;
303 #if defined(_MSC_VER) 304 #pragma warning ( pop ) 308 #endif// _LOG4CXX_ASYNC_APPENDER_H #define LOG4CXX_CAST_ENTRY(Interface)
Definition: object.h:153
#define END_LOG4CXX_CAST_MAP()
Definition: object.h:147
Implementation base class for all appenders.
Definition: appenderskeleton.h:43
std::shared_ptr< LoggingEvent > LoggingEventPtr
Definition: appender.h:37
This Interface is for attaching Appenders to objects.
Definition: appenderattachable.h:38
The AsyncAppender lets users log events asynchronously.
Definition: asyncappender.h:56
#define BEGIN_LOG4CXX_CAST_MAP()
Definition: object.h:141
LOG4CXX_PTR_DEF(Appender)
#define DECLARE_LOG4CXX_OBJECT(object)
Definition: object.h:39
std::shared_ptr< Appender > AppenderPtr
Definition: basicconfigurator.h:28
#define LOG4CXX_CAST_ENTRY_CHAIN(Interface)
Definition: object.h:159
LOG4CXX_LIST_DEF(AppenderList, AppenderPtr)
Definition: appender.h:32
std::basic_string< logchar > LogString
Definition: logstring.h:66