Crate secra_logger

Crate secra_logger 

Source
Expand description

Secra Logger - 生产级 Rust 日志系统库

基于 tracing 生态系统构建,支持结构化 JSON 日志、文件滚动、UTC+8 时区等特性。

§示例

use secra_logger::{LoggingConfig, LoggingModule, Logger};

// 创建日志配置
let config = LoggingConfig::default();

// 创建日志模块
let module = LoggingModule::new();

// 创建 Logger
let logger = Logger::new();

Re-exports§

pub use tracing;

Modules§

event
Events represent single points in time during the execution of a program.
span
Spans represent periods of time in which a program was executing in a particular context.

Macros§

debug
Constructs an event at the debug level.
error
Constructs an event at the error level.
event
Constructs a new Event.
info
Constructs an event at the info level.
span
Constructs a new span.
trace
Constructs an event at the trace level.
warn
Constructs an event at the warn level.

Structs§

Event
Events represent single points in time where something occurred during the execution of a program.
FieldNormalizationLayer
字段规范化 Layer
Level
Describes the level of verbosity of a span or event.
LogConsoleConfig
控制台输出配置
LogFieldsConfig
日志字段规范化配置
LogFileConfig
文件输出配置
Logger
Logger 组件
LoggingConfig
日志配置
LoggingModule
日志模块
LogrotateConfig
Logrotate 配置
Span
A handle representing a span, with the capability to enter the span if it exists.
VectorBatchConfig
Vector 批量配置
VectorConfig
Vector 日志收集器配置
VectorRequestConfig
Vector 请求配置
VectorSinkConfig
Vector 输出目标配置
VectorSourceConfig
Vector 源配置
VectorTransformConfig
Vector 转换配置

Enums§

OutputMode
日志输出模式

Traits§

Subscriber
Trait representing the functions required to collect trace data.

Functions§

normalize_field_name
规范化字段名(驼峰转点分隔)

Type Aliases§

LoggerComponent
Logger 类型别名(用于 ComponentRegistry)