github.com/gogf/gf@v1.16.9/.example/os/glog/glog_path.go (about)

     1  package main
     2  
     3  import (
     4  	"github.com/gogf/gf/frame/g"
     5  	"github.com/gogf/gf/os/gfile"
     6  )
     7  
     8  // 设置日志输出路径
     9  func main() {
    10  	path := "/tmp/glog"
    11  	g.Log().SetPath(path)
    12  	g.Log().Println("日志内容")
    13  	list, err := gfile.ScanDir(path, "*")
    14  	g.Dump(err)
    15  	g.Dump(list)
    16  }