mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-18 05:32:52 +00:00
09f3d68f6e
* Try fix macos server run * Doc macos build # Please enter the commit message for your changes. Lines starting * CLICKHOUSE-3957 start wip * tests wip * wip * wip * wip * wip * wip * wip * wip * fix * fix * Making logger for clickhouse-local * fixes * wip * wip * wip * wip * clean * cf * wip * fix * Update CMakeLists.txt * Update argsToConfig.h * Update argsToConfig.cpp * Update ExtendedLogChannel.h * Update OwnPatternFormatter.cpp
38 lines
1.1 KiB
C++
38 lines
1.1 KiB
C++
#include <optional>
|
||
#include <string>
|
||
#include <Poco/AutoPtr.h>
|
||
#include <Poco/FileChannel.h>
|
||
#include <Poco/Util/Application.h>
|
||
|
||
namespace Poco::Util
|
||
{
|
||
class AbstractConfiguration;
|
||
}
|
||
|
||
|
||
class Loggers
|
||
{
|
||
public:
|
||
/// Строит необходимые логгеры
|
||
void buildLoggers(Poco::Util::AbstractConfiguration & config, Poco::Logger & logger, const std::string & cmd_name = "");
|
||
|
||
/// Закрыть файлы с логами. При следующей записи, будут созданы новые файлы.
|
||
void closeLogs(Poco::Logger & logger);
|
||
|
||
std::optional<size_t> getLayer() const
|
||
{
|
||
return layer; /// layer выставляется в классе-наследнике BaseDaemonApplication.
|
||
}
|
||
|
||
protected:
|
||
std::optional<size_t> layer;
|
||
|
||
private:
|
||
/// Файлы с логами.
|
||
Poco::AutoPtr<Poco::FileChannel> log_file;
|
||
Poco::AutoPtr<Poco::FileChannel> error_log_file;
|
||
Poco::AutoPtr<Poco::Channel> syslog_channel;
|
||
/// Previous value of logger element in config. It is used to reinitialize loggers whenever the value changed.
|
||
std::string config_logger;
|
||
};
|