donnie4w / go-logger

High-performance Go logging library, with concurrency performance 10 times or more faster than the official library. Go高性能日志库,适用于高并发场景,并发性能是官方库10倍或以上
https://tlnet.top/logdoc
BSD 3-Clause "New" or "Revised" License
305 stars 103 forks source link

创建日志目录权限为666,当使用非root用户时无法写入日志 #12

Closed porson closed 7 years ago

porson commented 7 years ago

因为我把源码fork到本地以后拆分到自己的代码里了,没法提代码了,谁遇到了这个问题该一下创建目录的函数就好。 下面这个是我改好的: func mkdirlog(dir string) (e error) { _, er := os.Stat(dir) b := er == nil || os.IsExist(er) if !b { if err := os.MkdirAll(dir, 0775); err != nil { if os.IsPermission(err) { e = err } } } return }