CppCMS
|
log file based sink - sends messages to log file More...
#include <booster/booster/log.h>
Public Member Functions | |
file () | |
file (std::string const &file_name, int max_files=0) | |
void | open (std::string file_name) |
void | max_files (unsigned limit) |
void | append () |
void | set_timezone (std::string const &name) |
virtual void | log (message const &) |
Send message to the log. | |
Static Public Attributes | |
static const int | app = -1 |
log file based sink - sends messages to log file
booster::log::sinks::file::file | ( | ) |
Creates new object but does not open a file
booster::log::sinks::file::file | ( | std::string const & | file_name, |
int | max_files = 0 |
||
) |
Creates new file sink named file_name, if max_files = app, then no new files created but rather the log is appended to the existing file
void booster::log::sinks::file::append | ( | ) |
Append to output file rather then create new one.
void booster::log::sinks::file::max_files | ( | unsigned | limit | ) |
Enable file rotation and set the maximal number of files that should be kept.
Each time the log opened, the old files are renamed, if there are more files then limit, the oldest is removed
void booster::log::sinks::file::open | ( | std::string | file_name | ) |
Open log file
void booster::log::sinks::file::set_timezone | ( | std::string const & | name | ) |
Set the time-zone name that should be used in the message.
It should have a format GMT+XX:YY like "GMT+2:00" or "GMT-3". "GMT" can be used as well
If name is empty local time is used which is the default
|
static |
Flag that can be passed to constructor that specifies that the log should be appended to the existing file