Loading...
Searching...
No Matches
FileAppender.hh
Go to the documentation of this file.
/*
* FileAppender.hh
*
* Copyright 2000, LifeLine Networks BV (www.lifeline.nl). All rights reserved.
* Copyright 2000, Bastiaan Bakker. All rights reserved.
*
* See the COPYING file for the terms of usage and distribution.
*/
#ifndef _LOG4SHIB_FILEAPPENDER_HH
#define _LOG4SHIB_FILEAPPENDER_HH
#include <log4shib/Portability.hh>
#include <log4shib/LayoutAppender.hh>
#include <string>
#include <stdarg.h>
namespace log4shib {
class LOG4SHIB_EXPORT FileAppender : public LayoutAppender {
public:
FileAppender(const std::string& name, const std::string& fileName,
bool append = true, mode_t mode = 00644);
FileAppender(const std::string& name, int fd);
virtual ~FileAppender();
virtual bool reopen();
virtual void close();
virtual void setAppend(bool append);
virtual bool getAppend() const;
virtual void setMode(mode_t mode);
virtual mode_t getMode() const;
protected:
virtual void _append(const LoggingEvent& event);
const std::string _fileName;
int _fd;
int _flags;
mode_t _mode;
};
}
#endif // _LOG4SHIB_FILEAPPENDER_HH
LOG4SHIB_EXPORT
#define LOG4SHIB_EXPORT
Definition Export.hh:11
LayoutAppender.hh
Portability.hh
log4shib::FileAppender::_append
virtual void _append(const LoggingEvent &event)
Log in Appender specific way.
Definition FileAppender.cpp:100
log4shib::FileAppender::FileAppender
FileAppender(const std::string &name, const std::string &fileName, bool append=true, mode_t mode=00644)
Constructs a FileAppender.
Definition FileAppender.cpp:26
log4shib::FileAppender::_mode
mode_t _mode
Definition FileAppender.hh:88
log4shib::FileAppender::_fileName
const std::string _fileName
Definition FileAppender.hh:85
log4shib::FileAppender::getMode
virtual mode_t getMode() const
Gets the file open mode.
Definition FileAppender.cpp:96
log4shib::FileAppender::reopen
virtual bool reopen()
Reopens the logfile.
Definition FileAppender.cpp:109
log4shib::FileAppender::setAppend
virtual void setAppend(bool append)
Sets the append vs truncate flag.
Definition FileAppender.cpp:80
log4shib::FileAppender::setMode
virtual void setMode(mode_t mode)
Sets the file open mode.
Definition FileAppender.cpp:92
log4shib::FileAppender::getAppend
virtual bool getAppend() const
Gets the value of the 'append' option.
Definition FileAppender.cpp:88
log4shib::FileAppender::_fd
int _fd
Definition FileAppender.hh:86
log4shib::FileAppender::close
virtual void close()
Closes the logfile.
Definition FileAppender.cpp:73
log4shib::FileAppender::_flags
int _flags
Definition FileAppender.hh:87
log4shib::LayoutAppender::LayoutAppender
LayoutAppender(const std::string &name)
Definition LayoutAppender.cpp:15
log4shib
The top level namespace for all 'Log for C++' types and classes.
Definition AbortAppender.hh:16
log4shib::LoggingEvent
The internal representation of logging events.
Definition LoggingEvent.hh:32