146 virtual void close();
168 virtual void writeln(
const std::string& text,
const std::string& addr);
176 return (std::string(
"logfile"));
222 virtual void openInternal(
struct tm& time_info,
bool use_existing);
239 virtual bool isOpen()
const;
249 void writelnInternal(
const std::string& text);
255 std::string base_name_;
266 std::string file_name_;
272 std::string prerotate_;
275 std::string postrotate_;
std::map< std::string, std::string > ParameterMap
Database configuration parameter map.
static bool unregisterBackendFactory(const std::string &db_type, bool no_log=false)
Unregisters the backend factory function for a given backend type.
static bool registerBackendFactory(const std::string &db_type, const Factory &factory, bool no_log=false, DBVersion db_version=DBVersion())
Registers new backend factory function for a given backend type.
LegalLogMgr abstract class.
virtual void writeln(const std::string &text, const std::string &addr)
Appends a string to the current file.
virtual void close()
Closes the underlying file.
std::string getFileName() const
Returns the current file name.
std::string getBaseName() const
Returns the file base name.
static std::string getYearMonthDay(const struct tm &time_info)
Build the year-month-day string from a date.
virtual ~RotatingFile()
Destructor.
static isc::dhcp::LegalLogMgrPtr factory(const isc::db::DatabaseConnection::ParameterMap ¶meters)
Factory class method.
void useExistingFiles(struct tm &time_info)
Update file name with previously created file.
virtual void open()
Opens the current file for writing.
RotatingFile(const isc::db::DatabaseConnection::ParameterMap ¶meters)
Constructor.
virtual void rotate()
Rotates the file if necessary.
void apply(const isc::db::DatabaseConnection::ParameterMap ¶meters)
Parse file specification and create forensic log backend.
virtual std::string getType() const
Return backend type.
std::string getPath() const
Returns the file path.
virtual bool isOpen() const
Returns true if the file is open.
TimeUnit
Time unit type used to rotate file.
void updateFileNameAndTimestamp(struct tm &time_info, bool use_existing)
Function which updates the file name and internal timestamp from previously created file name (if it ...
virtual void openInternal(struct tm &time_info, bool use_existing)
Open file using specified timestamp.
boost::shared_ptr< LegalLogMgr > LegalLogMgrPtr
Defines a smart pointer to a LegalLogMgr.
Defines the logger used by the top-level component of kea-lfc.