log4cpp 1.1.6
Loading...
Searching...
No Matches
FileAppender.hh
Go to the documentation of this file.
1/*
2 * FileAppender.hh
3 *
4 * Copyright 2000, LifeLine Networks BV (www.lifeline.nl). All rights reserved.
5 * Copyright 2000, Bastiaan Bakker. All rights reserved.
6 *
7 * See the COPYING file for the terms of usage and distribution.
8 */
9
10#ifndef _LOG4CPP_FILEAPPENDER_HH
11#define _LOG4CPP_FILEAPPENDER_HH
12
15#include <stdarg.h>
16#include <string>
17
18namespace log4cpp {
19
21 public:
31 FileAppender(const std::string& name, const std::string& fileName, bool append = true, mode_t mode = 00644);
32
38 FileAppender(const std::string& name, int fd);
39 virtual ~FileAppender();
40
48 virtual bool reopen();
49
53 virtual void close();
54
63 virtual void setAppend(bool append);
64
68 virtual bool getAppend() const;
69
73 virtual void setMode(mode_t mode);
74
78 virtual mode_t getMode() const;
79
80 protected:
81 virtual void _append(const LoggingEvent& event);
82
83 const std::string _fileName;
84 int _fd;
85 int _flags;
86 mode_t _mode;
87 };
88} // namespace log4cpp
89
90#endif // _LOG4CPP_FILEAPPENDER_HH
#define LOG4CPP_EXPORT
Definition Export.hh:26
FileAppender(const std::string &name, const std::string &fileName, bool append=true, mode_t mode=00644)
Constructs a FileAppender.
Definition FileAppender.cpp:27
const std::string _fileName
Definition FileAppender.hh:83
virtual void _append(const LoggingEvent &event)
Log in Appender specific way.
Definition FileAppender.cpp:68
mode_t _mode
Definition FileAppender.hh:86
int _fd
Definition FileAppender.hh:84
int _flags
Definition FileAppender.hh:85
virtual void setAppend(bool append)
Sets the append vs truncate flag.
Definition FileAppender.cpp:48
virtual void setMode(mode_t mode)
Sets the file open mode.
Definition FileAppender.cpp:60
virtual void close()
Closes the logfile.
Definition FileAppender.cpp:41
virtual mode_t getMode() const
Gets the file open mode.
Definition FileAppender.cpp:64
virtual bool reopen()
Reopens the logfile.
Definition FileAppender.cpp:75
virtual bool getAppend() const
Gets the value of the 'append' option.
Definition FileAppender.cpp:56
LayoutAppender(const std::string &name)
Definition LayoutAppender.cpp:15
The top level namespace for all 'Log for C++' types and classes.
Definition AbortAppender.hh:16
The internal representation of logging events.
Definition LoggingEvent.hh:32