Documentation
¶
Index ¶
Constants ¶
View Source
const ( // ResultSuccess 表示成功执行 SQL 的结果标记 ResultSuccess = "success" // Firefly系统自定义头部(统一前缀) HeaderPrefix = "x-firefly-" // TraceId 为从 metadata 读取 trace id 的 key TraceId = HeaderPrefix + "trace-id" // UserId 为从 metadata 读取 user id 的 key UserId = HeaderPrefix + "user-id" // AppId 为从 metadata 读取调用方 app id 的 key AppId = HeaderPrefix + "app-id" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config struct {
// Config 复用 gorm 内置 logger.Config(包含 SlowThreshold/LogLevel/Colorful 等)
loger.Config
// 控制台是否输出日志
Console bool
// 数据库
Database string
// 数据库类型
DatabaseType uint32
}
Config 为自定义 gorm logger 的配置
type OperationLogger ¶ added in v0.9.0
type OperationLogger struct {
Database string `json:"database"`
Statement string `json:"statement"`
Result string `json:"result"`
Path string `json:"path"`
Duration uint64 `json:"duration"`
Level uint32 `json:"level"`
Type uint32 `json:"type"`
TraceId string `json:"trace_id"`
UserId string `json:"user_id"`
TargetAppId string `json:"target_app_id"`
InvokeAppId string `json:"invoke_app_id"`
}
OperationLogger 表示操作日志。
Click to show internal directories.
Click to hide internal directories.