log4shib 2.0.1
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 _LOG4SHIB_FILEAPPENDER_HH
11#define _LOG4SHIB_FILEAPPENDER_HH
12
15#include <string>
16#include <stdarg.h>
17
18namespace log4shib {
19
21 public:
22
32 FileAppender(const std::string& name, const std::string& fileName,
33 bool append = true, mode_t mode = 00644);
34
40 FileAppender(const std::string& name, int fd);
41 virtual ~FileAppender();
42
50 virtual bool reopen();
51
55 virtual void close();
56
65 virtual void setAppend(bool append);
66
70 virtual bool getAppend() const;
71
75 virtual void setMode(mode_t mode);
76
80 virtual mode_t getMode() const;
81
82 protected:
83 virtual void _append(const LoggingEvent& event);
84
85 const std::string _fileName;
86 int _fd;
87 int _flags;
88 mode_t _mode;
89 };
90}
91
92#endif // _LOG4SHIB_FILEAPPENDER_HH
#define LOG4SHIB_EXPORT
Definition Export.hh:11
virtual void _append(const LoggingEvent &event)
Log in Appender specific way.
Definition FileAppender.cpp:100
FileAppender(const std::string &name, const std::string &fileName, bool append=true, mode_t mode=00644)
Constructs a FileAppender.
Definition FileAppender.cpp:26
mode_t _mode
Definition FileAppender.hh:88
const std::string _fileName
Definition FileAppender.hh:85
virtual mode_t getMode() const
Gets the file open mode.
Definition FileAppender.cpp:96
virtual bool reopen()
Reopens the logfile.
Definition FileAppender.cpp:109
virtual void setAppend(bool append)
Sets the append vs truncate flag.
Definition FileAppender.cpp:80
virtual void setMode(mode_t mode)
Sets the file open mode.
Definition FileAppender.cpp:92
virtual bool getAppend() const
Gets the value of the 'append' option.
Definition FileAppender.cpp:88
int _fd
Definition FileAppender.hh:86
virtual void close()
Closes the logfile.
Definition FileAppender.cpp:73
int _flags
Definition FileAppender.hh:87
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