package
0.1.5
Repository: https://github.com/silentred/toolkit.git
Documentation: pkg.go.dev

# README

Echo logger with rotator

Usage

package main

import ()
	"github.com/labstack/echo"
	"github.com/silentred/rotator"
)

// Echo is the web engine
var Echo *echo.Echo

func init() {
	Echo = echo.New()
}

func main() {
	initLogger()
    Echo.Logger.Info("test")
	Echo.Start(":8090")
}

func initLogger() {
	path := "storage/log"
	appName := "app"
	limitSize := 100 << 20 // 100MB

	r := rotator.NewFileSizeRotator(path, appName, "log", limitSize)
	Echo.Logger.SetOutput(r) 
	Echo.Logger.SetLevel(elog.WARN)
}

# Functions

NewDaySpliter gets a new DaySpliter.
No description provided by the author
NewSizeSpliter return a new SizeSpliter.

# Structs

DaySpliter rotates log file by day.
No description provided by the author
SizeSpliter rotates log file by size.

# Interfaces

No description provided by the author
No description provided by the author