aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/logger/rotating_file.h
diff options
context:
space:
mode:
Diffstat (limited to 'library/cpp/logger/rotating_file.h')
-rw-r--r--library/cpp/logger/rotating_file.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/library/cpp/logger/rotating_file.h b/library/cpp/logger/rotating_file.h
new file mode 100644
index 0000000000..cb047f25fb
--- /dev/null
+++ b/library/cpp/logger/rotating_file.h
@@ -0,0 +1,20 @@
+#pragma once
+
+#include "backend.h"
+
+#include <util/generic/fwd.h>
+#include <util/generic/ptr.h>
+
+class TRotatingFileLogBackend: public TLogBackend {
+public:
+ TRotatingFileLogBackend(const TString& preRotatePath, const TString& postRotatePath, const ui64 maxSizeBytes);
+ TRotatingFileLogBackend(const TString& path, const ui64 maxSizeBytes, const ui32 rotatedFilesCount);
+ ~TRotatingFileLogBackend() override;
+
+ void WriteData(const TLogRecord& rec) override;
+ void ReopenLog() override;
+
+private:
+ class TImpl;
+ TAtomicSharedPtr<TImpl> Impl_;
+};