From c0bcf38e3b030dce89ce23cbb397338364b78400 Mon Sep 17 00:00:00 2001 From: Emmanuel Bosquet Date: Fri, 2 Feb 2024 10:28:46 +0100 Subject: [PATCH] draft: add tag and time to BinaryAccessLog --- command/src/command.proto | 4 ++++ command/src/logging.rs | 4 +++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/command/src/command.proto b/command/src/command.proto index a0676ae45..b50f56cdf 100644 --- a/command/src/command.proto +++ b/command/src/command.proto @@ -633,7 +633,11 @@ message BinaryAccessLog { required uint64 bytes_in = 14; required uint64 bytes_out = 15; optional string user_agent = 16; + // custom tags as key-values, for instance owner_id: MyOrganisation map tags = 17; + // short description of which process sends the log, for instance: "WRK-02" + required string tag = 18; + required Uint128 time = 19; } // this matches the way the rusty_ulid crate represent a ULID diff --git a/command/src/logging.rs b/command/src/logging.rs index 4f8638c8d..c39bf9e9a 100644 --- a/command/src/logging.rs +++ b/command/src/logging.rs @@ -15,7 +15,9 @@ use mio::net::UnixDatagram; use prost::{encoding::encoded_len_varint, Message}; use rand::{distributions::Alphanumeric, thread_rng, Rng}; -use crate::{access_logs::RequestRecord, bind_format_args, config::Config}; +pub use crate::access_logs::*; + +use crate::{bind_format_args, config::Config}; thread_local! { pub static LOGGER: RefCell = RefCell::new(Logger::new());