pub struct ToolCallLoggingLayer { /* private fields */ }Expand description
Tower layer that adds audit logging for tool call requests.
This layer intercepts tools/call requests and emits structured
tracing events with the tool name, execution duration, and result
status. Non-tool-call requests pass through with zero overhead.
Events are emitted with tracing target mcp::tools, which can be used
for filtering in your tracing subscriber configuration.
§Example
ⓘ
use tower_mcp::{McpRouter, StdioTransport};
use tower_mcp::middleware::ToolCallLoggingLayer;
let router = McpRouter::new().server_info("my-server", "1.0.0");
let mut transport = StdioTransport::new(router)
.layer(ToolCallLoggingLayer::new());Implementations§
Trait Implementations§
Source§impl Clone for ToolCallLoggingLayer
impl Clone for ToolCallLoggingLayer
Source§fn clone(&self) -> ToolCallLoggingLayer
fn clone(&self) -> ToolCallLoggingLayer
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ToolCallLoggingLayer
impl Debug for ToolCallLoggingLayer
Source§impl Default for ToolCallLoggingLayer
impl Default for ToolCallLoggingLayer
Source§impl<S> Layer<S> for ToolCallLoggingLayer
impl<S> Layer<S> for ToolCallLoggingLayer
impl Copy for ToolCallLoggingLayer
Auto Trait Implementations§
impl Freeze for ToolCallLoggingLayer
impl RefUnwindSafe for ToolCallLoggingLayer
impl Send for ToolCallLoggingLayer
impl Sync for ToolCallLoggingLayer
impl Unpin for ToolCallLoggingLayer
impl UnsafeUnpin for ToolCallLoggingLayer
impl UnwindSafe for ToolCallLoggingLayer
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more