2019-02-25 14:48:22 +01:00
|
|
|
/* Icinga 2 | (c) 2012 Icinga GmbH | GPLv2+ */
|
2013-06-06 11:26:00 +02:00
|
|
|
|
2013-06-06 11:26:30 +02:00
|
|
|
#ifndef FILELOGGER_H
|
|
|
|
#define FILELOGGER_H
|
2013-06-06 11:26:00 +02:00
|
|
|
|
2014-05-25 16:23:35 +02:00
|
|
|
#include "base/i2-base.hpp"
|
2018-01-18 13:50:38 +01:00
|
|
|
#include "base/filelogger-ti.hpp"
|
2013-06-06 11:26:00 +02:00
|
|
|
|
|
|
|
namespace icinga
|
|
|
|
{
|
|
|
|
|
|
|
|
/**
|
2013-06-06 11:26:30 +02:00
|
|
|
* A logger that logs to a file.
|
2013-06-06 11:26:00 +02:00
|
|
|
*
|
|
|
|
* @ingroup base
|
|
|
|
*/
|
2018-01-04 06:11:04 +01:00
|
|
|
class FileLogger final : public ObjectImpl<FileLogger>
|
2013-06-06 11:26:00 +02:00
|
|
|
{
|
|
|
|
public:
|
2014-11-03 00:44:04 +01:00
|
|
|
DECLARE_OBJECT(FileLogger);
|
|
|
|
DECLARE_OBJECTNAME(FileLogger);
|
2013-06-06 11:26:00 +02:00
|
|
|
|
2015-02-13 11:28:43 +01:00
|
|
|
static void StatsFunc(const Dictionary::Ptr& status, const Array::Ptr& perfdata);
|
2014-02-17 16:34:18 +01:00
|
|
|
|
2018-01-04 05:12:56 +01:00
|
|
|
void Start(bool runtimeCreated) override;
|
2014-05-22 11:22:30 +02:00
|
|
|
|
|
|
|
private:
|
2018-01-04 04:25:35 +01:00
|
|
|
void ReopenLogFile();
|
2013-06-06 11:26:00 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2013-06-06 11:26:30 +02:00
|
|
|
#endif /* FILELOGGER_H */
|