#include #include #include #include #include #include "OwnFormattingChannel.h" namespace Poco::Util { class AbstractConfiguration; } namespace DB { class SensitiveDataMasker; } class Loggers { public: void buildLoggers(Poco::Util::AbstractConfiguration & config, Poco::Logger & logger, const std::string & cmd_name = ""); void setLoggerSensitiveDataMasker(Poco::Logger & logger, DB::SensitiveDataMasker * sensitive_data_masker); /// Close log files. On next log write files will be reopened. void closeLogs(Poco::Logger & logger); std::optional getLayer() const { return layer; /// layer setted in inheritor class BaseDaemonApplication. } protected: std::optional layer; private: Poco::AutoPtr log_file; Poco::AutoPtr error_log_file; Poco::AutoPtr syslog_channel; /// Previous value of logger element in config. It is used to reinitialize loggers whenever the value changed. std::string config_logger; };