7#include <unordered_map>
9#include <userver/components/component_fwd.hpp>
10#include <userver/components/impl/component_base.hpp>
11#include <userver/concurrent/async_event_source.hpp>
12#include <userver/os_signals/component.hpp>
14#include <userver/utils/periodic_task.hpp>
15#include <userver/utils/statistics/entry.hpp>
16#include <userver/utils/statistics/writer.hpp>
20USERVER_NAMESPACE_BEGIN
77class Logging
final :
public impl::ComponentBase {
84 Logging(
const ComponentConfig&,
const ComponentContext&);
98 void StartSocketLoggingDebug();
99 void StopSocketLoggingDebug();
103 void TryReopenFiles();
105 void WriteStatistics(
utils::statistics::Writer& writer)
const;
107 static yaml_config::Schema GetStaticConfigSchema();
110 void Init(
const ComponentConfig&,
const ComponentContext&);
111 void Stop()
noexcept;
115 engine::TaskProcessor* fs_task_processor_{
nullptr};
116 std::unordered_map<std::string, std::shared_ptr<logging::impl::TpLogger>>
118 utils::PeriodicTask flush_task_;
119 logging::impl::TcpSocketSink* socket_sink_{
nullptr};
121 utils::statistics::Entry statistics_holder_;
125inline constexpr bool kHasValidate<Logging> =
true;