11 #ifdef LOG4CPP_HAVE_IO_H 14 #ifdef LOG4CPP_HAVE_UNISTD_H 28 const std::string& fileName,
33 _flags(O_CREAT | O_APPEND | O_WRONLY),
44 _flags(O_CREAT | O_APPEND | O_WRONLY),
68 return (
_flags & O_TRUNC) == 0;
80 std::string message(
_getLayout().format(event));
81 if (!::write(
_fd, message.data(), message.length())) {
104 std::string name, filename;
108 params.
get_for(
"file appender").
required(
"name", name)(
"filename", filename)
109 .optional(
"append", append)(
"mode", mode);
111 return std::auto_ptr<Appender>(
new FileAppender(name, filename, append, mode));
const std::string _fileName
virtual void setAppend(bool append)
required_params_validator required(const char *param, T &value) const
virtual void _append(const LoggingEvent &event)
virtual bool getAppend() const
FileAppender(const std::string &name, const std::string &fileName, bool append=true, mode_t mode=00644)
virtual void setMode(mode_t mode)
virtual mode_t getMode() const
std::auto_ptr< Appender > create_file_appender(const FactoryParams &)
details::parameter_validator get_for(const char *tag) const