mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-22 15:42:02 +00:00
Merge pull request #54807 from ClickHouse/own
Make clickhouse-local logging (server_logs_file) prepend timestamps etc
This commit is contained in:
commit
165b0f0afe
@ -32,6 +32,8 @@
|
|||||||
#include <Common/randomSeed.h>
|
#include <Common/randomSeed.h>
|
||||||
#include <Common/ThreadPool.h>
|
#include <Common/ThreadPool.h>
|
||||||
#include <Loggers/Loggers.h>
|
#include <Loggers/Loggers.h>
|
||||||
|
#include <Loggers/OwnFormattingChannel.h>
|
||||||
|
#include <Loggers/OwnPatternFormatter.h>
|
||||||
#include <IO/ReadBufferFromFile.h>
|
#include <IO/ReadBufferFromFile.h>
|
||||||
#include <IO/ReadBufferFromString.h>
|
#include <IO/ReadBufferFromString.h>
|
||||||
#include <IO/WriteBufferFromFileDescriptor.h>
|
#include <IO/WriteBufferFromFileDescriptor.h>
|
||||||
@ -599,7 +601,9 @@ void LocalServer::processConfig()
|
|||||||
{
|
{
|
||||||
auto poco_logs_level = Poco::Logger::parseLevel(level);
|
auto poco_logs_level = Poco::Logger::parseLevel(level);
|
||||||
Poco::Logger::root().setLevel(poco_logs_level);
|
Poco::Logger::root().setLevel(poco_logs_level);
|
||||||
Poco::Logger::root().setChannel(Poco::AutoPtr<Poco::SimpleFileChannel>(new Poco::SimpleFileChannel(server_logs_file)));
|
Poco::AutoPtr<OwnPatternFormatter> pf = new OwnPatternFormatter;
|
||||||
|
Poco::AutoPtr<OwnFormattingChannel> log = new OwnFormattingChannel(pf, new Poco::SimpleFileChannel(server_logs_file));
|
||||||
|
Poco::Logger::root().setChannel(log);
|
||||||
logging_initialized = true;
|
logging_initialized = true;
|
||||||
}
|
}
|
||||||
else if (logging || is_interactive)
|
else if (logging || is_interactive)
|
||||||
|
Loading…
Reference in New Issue
Block a user