Server access_log middleware
Classes | |
class | Component |
gRPC server access log middleware component. Writes one TSKV log line per handled RPC in a static format. This log is intended to be collected, parsed and stored for audit or extended statistics purposes. More... | |
Functions | |
void | SetAdditionalLogKeys (MiddlewareCallContext &context, logging::LogExtra &&log_extra) |
Adds or extends log extra fields for gRPC access logging. | |
Variables | |
const utils::AnyStorageDataTag< ugrpc::server::StorageContext, logging::LogExtra > | kLogExtraTag |
Storage to handle additional fields in access_log. | |
void ugrpc::server::middlewares::access_log::SetAdditionalLogKeys | ( | MiddlewareCallContext & | context, |
logging::LogExtra && | log_extra ) |
Adds or extends log extra fields for gRPC access logging.
context | Middleware call context containing the storage |
log_extra | Additional log fields to add (will be moved from) context,
logging::LogExtra{
std::pair<std::string, std::string>("user_id", "12345"),
std::pair<std::string, std::string>("session_id", "abc-def-ghi"),
std::pair<std::string, std::string>("request_id", "req-98765"),
std::pair<std::string, std::string>("custom_tag", "test-value"),
std::pair<std::string, std::string>("numeric_tag", "42"),
}
);
}
|
If log extra fields already exist in the context, extends them with new fields. Otherwise, creates new log extra storage with the provided fields.
|
inline |
Storage to handle additional fields in access_log.
Definition at line 19 of file component.hpp.