mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-25 00:52:02 +00:00
Ignore text_log for Keeper
This commit is contained in:
parent
9b9f37a4f1
commit
5c47b09114
@ -182,6 +182,11 @@ std::string Keeper::getDefaultConfigFileName() const
|
||||
return "keeper_config.xml";
|
||||
}
|
||||
|
||||
bool Keeper::allowTextLog() const
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
void Keeper::handleCustomArguments(const std::string & arg, [[maybe_unused]] const std::string & value) // NOLINT
|
||||
{
|
||||
if (arg == "force-recovery")
|
||||
|
@ -65,6 +65,8 @@ protected:
|
||||
|
||||
std::string getDefaultConfigFileName() const override;
|
||||
|
||||
bool allowTextLog() const override;
|
||||
|
||||
private:
|
||||
Poco::Net::SocketAddress socketBindListen(Poco::Net::ServerSocket & socket, const std::string & host, UInt16 port, [[maybe_unused]] bool secure = false) const;
|
||||
|
||||
|
@ -263,7 +263,7 @@ void Loggers::buildLoggers(Poco::Util::AbstractConfiguration & config, Poco::Log
|
||||
}
|
||||
}
|
||||
#ifndef WITHOUT_TEXT_LOG
|
||||
if (config.has("text_log"))
|
||||
if (allowTextLog() && config.has("text_log"))
|
||||
{
|
||||
String text_log_level_str = config.getString("text_log.level", "trace");
|
||||
int text_log_level = Poco::Logger::parseLevel(text_log_level_str);
|
||||
|
@ -23,6 +23,10 @@ public:
|
||||
/// Close log files. On next log write files will be reopened.
|
||||
void closeLogs(Poco::Logger & logger);
|
||||
|
||||
virtual ~Loggers() = default;
|
||||
|
||||
protected:
|
||||
virtual bool allowTextLog() const { return true; }
|
||||
|
||||
private:
|
||||
Poco::AutoPtr<Poco::FileChannel> log_file;
|
||||
|
@ -107,6 +107,10 @@ void OwnSplitChannel::logSplit(const Poco::Message & msg)
|
||||
[[maybe_unused]] bool push_result = logs_queue->emplace(std::move(columns));
|
||||
}
|
||||
|
||||
auto text_log_locked = text_log.lock();
|
||||
if (!text_log_locked)
|
||||
return;
|
||||
|
||||
/// Also log to system.text_log table, if message is not too noisy
|
||||
auto text_log_max_priority_loaded = text_log_max_priority.load(std::memory_order_relaxed);
|
||||
if (text_log_max_priority_loaded && msg.getPriority() <= text_log_max_priority_loaded)
|
||||
@ -146,9 +150,6 @@ void OwnSplitChannel::logSplit(const Poco::Message & msg)
|
||||
|
||||
#undef SET_VALUE_IF_EXISTS
|
||||
|
||||
std::shared_ptr<SystemLogQueue<TextLogElement>> text_log_locked{};
|
||||
text_log_locked = text_log.lock();
|
||||
if (text_log_locked)
|
||||
text_log_locked->push(std::move(elem));
|
||||
}
|
||||
#endif
|
||||
|
@ -1,7 +1,6 @@
|
||||
#pragma once
|
||||
|
||||
#include <atomic>
|
||||
#include <vector>
|
||||
#include <map>
|
||||
#include <Poco/AutoPtr.h>
|
||||
#include <Poco/Channel.h>
|
||||
|
Loading…
Reference in New Issue
Block a user