00001 #ifndef RGMAAPPENDER_H 00002 #define RGMAAPPENDER_H 00003 #include "rgma/RGMADateFormat.h" 00004 #include "rgma/RGMATimeFormat.h" 00005 #include "rgma/Constants.h" 00006 #include "log4cxx/spi/filter.h" 00007 #include "log4cxx/spi/loggingevent.h" 00008 #include "log4cxx/appenderskeleton.h" 00009 #include "log4cxx/helpers/dateformat.h" 00010 #include "rgma/PrimaryProducer.h" 00011 00012 using namespace log4cxx; 00013 using namespace log4cxx::helpers; 00014 using namespace log4cxx::spi; 00015 00016 using glite::rgma::PrimaryProducer; 00017 namespace rgma 00018 { 00019 namespace log4cpp 00020 { 00021 class RGMAAppender; 00022 typedef helpers::ObjectPtrT<RGMAAppender> RGMAAppenderPtr; 00027 class RGMAAppender : public AppenderSkeleton 00028 { 00029 00030 DECLARE_LOG4CXX_OBJECT(RGMAAppender) 00031 00032 BEGIN_LOG4CXX_CAST_MAP() 00033 LOG4CXX_CAST_ENTRY(RGMAAppender) 00034 LOG4CXX_CAST_ENTRY_CHAIN(AppenderSkeleton) 00035 END_LOG4CXX_CAST_MAP() 00036 public: 00037 RGMAAppender::RGMAAppender(); 00042 RGMAAppender(const std::string& name); 00043 00044 virtual ~RGMAAppender(); 00050 virtual void append(const LoggingEventPtr& event); 00057 void activateOptions(); 00058 00063 void setOption(const String& option, const String& value); 00064 00069 bool requiresLayout()const; 00074 void close(); 00075 00076 private: 00077 PrimaryProducer* m_producer; 00082 void createProducer(); 00083 std::string m_jobName; 00084 std::string m_filter; 00085 std::string m_terminationInterval; 00086 std::string m_latestRetentionPeriod; 00087 std::string m_historyRetentionPeriod; 00088 00089 }; 00090 } 00091 } 00092 #endif