Documentation
¶
Index ¶
- Variables
- func Download(ctx *gin.Context)
- func DownloadLogs(ctx *gin.Context, path string) *errors.Error
- func GetCategories(ctx *gin.Context)
- func GetLevels(ctx *gin.Context)
- func ListLogFiles(opts SearchOptions) (map[string]string, error)
- func Monitor(ctx *gin.Context)
- func MonitorLogs(ctx *gin.Context, opts SearchOptions) *errors.Error
- func Near(ctx *gin.Context)
- func Search(ctx *gin.Context)
- type ContextLogLine
- type LogRecord
- type MatchedRecord
- type SearchOptions
Constants ¶
This section is empty.
Variables ¶
View Source
var Categories = []string{"commons", "rest", "console"}
View Source
var Levels = []string{"debug", "info", "warn", "error", "fatal", "dpanic"}
Functions ¶
func DownloadLogs ¶
DownloadLogs downloads logs based on categories and conditions
func GetCategories ¶ added in v0.0.33
func ListLogFiles ¶
func ListLogFiles(opts SearchOptions) (map[string]string, error)
func MonitorLogs ¶
func MonitorLogs(ctx *gin.Context, opts SearchOptions) *errors.Error
MonitorLogs monitors logs based on categories and conditions in real-time
Types ¶
type ContextLogLine ¶
type ContextLogLine struct {
FilePath string `json:"path"`
LineNumber int64 `json:"line"`
Content string `json:"content"`
Record *LogRecord `json:"record"`
}
func FetchContextLines ¶
func FetchContextLines(filePath string, centerLine, contextRange int64) ([]ContextLogLine, *errors.Error)
FetchContextLines Read context lines around the center line
type LogRecord ¶
type MatchedRecord ¶
type MatchedRecord struct {
FilePath string `json:"path"`
LineNumber int64 `json:"line"`
Record *LogRecord `json:"record"`
}
func SearchLogs ¶
func SearchLogs(opts SearchOptions) ([]MatchedRecord, *errors.Error)
func (MatchedRecord) ToJsonStr ¶
func (m MatchedRecord) ToJsonStr() string
type SearchOptions ¶
type SearchOptions struct {
Categories []string `json:"categories" form:"categories"`
Level string `json:"level" form:"level"`
TraceID string `json:"traceID" form:"traceID"`
Keyword string `json:"keyword" form:"keyword"`
StartTime string `json:"startTime" form:"startTime"`
EndTime string `json:"endTime" form:"endTime"`
RootDir string `json:"root_dir" form:"rootDir"`
Size int `json:"size" form:"size"`
LastPath string `json:"lastPath" form:"lastPath"`
LastLine int64 `json:"lastLine" form:"lastLine"`
}
Click to show internal directories.
Click to hide internal directories.