pub struct TracingLayer { /* private fields */ }Expand description
Main tracing layer that can be added to an Axum application
Implementations§
Source§impl TracingLayer
impl TracingLayer
Sourcepub fn new(base_path: &str) -> Self
pub fn new(base_path: &str) -> Self
Create a new TracingLayer with the specified base path
§Arguments
base_path- The base path for all tracing UI routes (e.g., “/tracing”)
§Example
use axum::Router;
use axum::routing::get;
use tracing_web_console::TracingLayer;
let app = Router::new()
.route("/", get(|| async { "Hello World" }))
.merge(TracingLayer::new("/tracing").into_router());Sourcepub fn with_capacity(base_path: &str, capacity: usize) -> Self
pub fn with_capacity(base_path: &str, capacity: usize) -> Self
Create a new TracingLayer with custom storage capacity
§Arguments
base_path- The base path for all tracing UI routescapacity- Maximum number of log events to store in memory
Sourcepub fn into_router(self) -> Router
pub fn into_router(self) -> Router
Merge this tracing layer with an existing Axum router
This is the recommended way to add the tracing UI to your application
§Example
use axum::Router;
use axum::routing::get;
use tracing_web_console::TracingLayer;
let app = Router::new()
.route("/", get(|| async { "Hello World" }))
.merge(TracingLayer::new("/tracing").into_router());Trait Implementations§
Source§impl Clone for TracingLayer
impl Clone for TracingLayer
Source§fn clone(&self) -> TracingLayer
fn clone(&self) -> TracingLayer
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 moreAuto Trait Implementations§
impl Freeze for TracingLayer
impl !RefUnwindSafe for TracingLayer
impl Send for TracingLayer
impl Sync for TracingLayer
impl Unpin for TracingLayer
impl !UnwindSafe for TracingLayer
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