CppCMS

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- Class List
- Class Hierarchy
- Class Members

Public Member Functions | Static Public Attributes | List of all members
booster::log::sinks::file Class Reference

log file based sink - sends messages to log file More...

`#include <booster/booster/log.h>`

Inheritance diagram for booster::log::sinks::file:

## 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

## Detailed Description

log file based sink - sends messages to log file

## Constructor & Destructor Documentation

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

New in CppCMS 1.2

## Member Function Documentation

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

## Member Data Documentation

const int booster::log::sinks::file::app = -1
| static

Flag that can be passed to constructor that specifies that the log should be appended to the existing file

New in CppCMS 1.2

The documentation for this class was generated from the following file:

- booster/log.h