7#include <unordered_map>
9#include <userver/alerts/storage.hpp>
10#include <userver/components/component_fwd.hpp>
11#include <userver/components/impl/component_base.hpp>
12#include <userver/concurrent/async_event_source.hpp>
13#include <userver/os_signals/component.hpp>
15#include <userver/utils/fast_pimpl.hpp>
16#include <userver/utils/periodic_task.hpp>
17#include <userver/utils/statistics/entry.hpp>
18#include <userver/utils/statistics/writer.hpp>
22USERVER_NAMESPACE_BEGIN
79class Logging
final :
public impl::ComponentBase {
86 Logging(
const ComponentConfig&,
const ComponentContext&);
100 void StartSocketLoggingDebug(
const std::optional<
logging::
Level>& log_level);
101 void StopSocketLoggingDebug(
const std::optional<
logging::
Level>& log_level);
105 void TryReopenFiles();
107 void WriteStatistics(utils::statistics::Writer& writer)
const;
109 static yaml_config::Schema GetStaticConfigSchema();
112 void Init(
const ComponentConfig&,
const ComponentContext&);
113 void Stop()
noexcept;
117 engine::TaskProcessor* fs_task_processor_{
nullptr};
118 std::unordered_map<std::string, std::shared_ptr<logging::impl::TpLogger>>
120 utils::PeriodicTask flush_task_;
121 logging::impl::TcpSocketSink* socket_sink_{
nullptr};
122 alerts::Storage& alert_storage_;
126 utils::statistics::Entry statistics_holder_;
130inline constexpr bool kHasValidate<Logging> =
true;