userver
C++ Async Framework
Toggle main menu visibility
Documentation
API Groups
Namespaces
Reference
Class List
Class Index
File List
Macros
All
e
i
l
r
t
u
Functions
Macros
e
i
l
r
t
u
Examples
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Modules
Pages
Concepts
Loading...
Searching...
No Matches
on_log_rotate.hpp
Go to the documentation of this file.
1
#
pragma
once
2
3
/// @file userver/server/handlers/on_log_rotate.hpp
4
/// @brief @copybrief server::handlers::OnLogRotate
5
6
#
include
<
userver
/
server
/
handlers
/
http_handler_base
.
hpp
>
7
8
USERVER_NAMESPACE_BEGIN
9
10
namespace
components
{
11
class
Logging;
12
}
// namespace components
13
14
namespace
server::handlers {
15
// clang-format off
16
17
/// @ingroup userver_components userver_http_handlers
18
///
19
/// @brief Handler that controls logging levels of all the loggers.
20
///
21
/// The component has no service configuration except the
22
/// @ref userver_http_handlers "common handler options".
23
///
24
/// ## Static configuration example:
25
///
26
/// @snippet components/common_server_component_list_test.cpp Sample handler log level component config
27
///
28
/// ## Scheme
29
/// POST request reopens log file for all loggers.
30
/// Returns 200 status code after successful operation.
31
/// If at least one of files was not successfully reopened returns 500 status
32
/// code and error messages separated by comma in response body.
33
34
// clang-format on
35
class
OnLogRotate
final
:
public
HttpHandlerBase
{
36
public
:
37
OnLogRotate(
const
components
::ComponentConfig& config,
const
components
::ComponentContext& component_context);
38
39
/// @ingroup userver_component_names
40
/// @brief The default name of server::handlers::OnLogRotate
41
static
constexpr
std::string_view
kName
=
"handler-on-log-rotate"
;
42
43
std::string
HandleRequestThrow
(
const
http
::HttpRequest& request,
request
::RequestContext&)
const
override
;
44
45
static
yaml_config
::Schema GetStaticConfigSchema();
46
47
private
:
48
components
::Logging& logging_component_;
49
};
35
class
OnLogRotate
final
:
public
HttpHandlerBase
{
…
};
50
51
}
// namespace server::handlers
52
53
template
<>
54
inline
constexpr
bool
components
::kHasValidate<server::handlers::OnLogRotate> =
true
;
55
56
USERVER_NAMESPACE_END
userver
server
handlers
on_log_rotate.hpp
Generated on Wed Apr 30 2025 15:54:20 for userver by
Doxygen
1.13.2