00001 #ifndef RGMAAPPENDER_H 00002 #define RGMAAPPENDER_H 00003 #include "RGMADateFormat.h" 00004 #include "RGMATimeFormat.h" 00005 #include "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; 00023 00024 class RGMAAppender : public AppenderSkeleton 00025 { 00026 00027 DECLARE_LOG4CXX_OBJECT(RGMAAppender) 00028 00029 BEGIN_LOG4CXX_CAST_MAP() 00030 LOG4CXX_CAST_ENTRY(RGMAAppender) 00031 LOG4CXX_CAST_ENTRY_CHAIN(AppenderSkeleton) 00032 END_LOG4CXX_CAST_MAP() 00033 public: 00034 RGMAAppender::RGMAAppender(); 00039 RGMAAppender(const std::string& name); 00040 00041 virtual ~RGMAAppender(); 00047 virtual void append(const LoggingEventPtr& event); 00054 void activateOptions(); 00055 00060 void setOption(const String& option, const String& value); 00061 00066 bool requiresLayout()const; 00071 void close(); 00072 00073 private: 00074 PrimaryProducer* m_producer; 00079 void createProducer(); 00080 std::string m_jobName; 00081 std::string m_filter; 00082 std::string m_terminationInterval; 00083 std::string m_latestRetentionPeriod; 00084 std::string m_historyRetentionPeriod; 00085 00086 }; 00087 } 00088 } 00089 #endif