Probably breaks everything, lowercase pterodactyl
This commit is contained in:
@@ -1,18 +1,18 @@
|
||||
package tools
|
||||
package utils
|
||||
|
||||
import (
|
||||
"os"
|
||||
"path/filepath"
|
||||
"time"
|
||||
//"time"
|
||||
|
||||
"github.com/Pterodactyl/wings/constants"
|
||||
"github.com/pterodactyl/wings/constants"
|
||||
|
||||
rotatelogs "github.com/lestrrat/go-file-rotatelogs"
|
||||
"github.com/rifflock/lfshook"
|
||||
//"github.com/lestrrat/go-file-rotatelogs"
|
||||
//"github.com/rifflock/lfshook"
|
||||
log "github.com/sirupsen/logrus"
|
||||
"github.com/spf13/viper"
|
||||
|
||||
"github.com/Pterodactyl/wings/config"
|
||||
"github.com/pterodactyl/wings/config"
|
||||
)
|
||||
|
||||
// InitLogging initalizes the logging library for first use.
|
||||
@@ -30,20 +30,20 @@ func ConfigureLogging() error {
|
||||
if err := os.MkdirAll(path, constants.DefaultFolderPerms); err != nil {
|
||||
return err
|
||||
}
|
||||
writer := rotatelogs.New(
|
||||
path+"/wings.%Y%m%d-%H%M.log",
|
||||
rotatelogs.WithLinkName(path),
|
||||
rotatelogs.WithMaxAge(time.Duration(viper.GetInt(config.LogDeleteAfterDays))*time.Hour*24),
|
||||
rotatelogs.WithRotationTime(time.Duration(604800)*time.Second),
|
||||
)
|
||||
|
||||
log.AddHook(lfshook.NewHook(lfshook.WriterMap{
|
||||
log.DebugLevel: writer,
|
||||
log.InfoLevel: writer,
|
||||
log.WarnLevel: writer,
|
||||
log.ErrorLevel: writer,
|
||||
log.FatalLevel: writer,
|
||||
}))
|
||||
//writer := rotatelogs.New(
|
||||
// path+"/wings.%Y%m%d-%H%M.log",
|
||||
// rotatelogs.WithLinkName(path),
|
||||
// rotatelogs.WithMaxAge(time.Duration(viper.GetInt(config.LogDeleteAfterDays))*time.Hour*24),
|
||||
// rotatelogs.WithRotationTime(time.Duration(604800)*time.Second),
|
||||
//)
|
||||
//
|
||||
//log.AddHook(lfshook.NewHook(lfshook.WriterMap{
|
||||
// log.DebugLevel: writer,
|
||||
// log.InfoLevel: writer,
|
||||
// log.WarnLevel: writer,
|
||||
// log.ErrorLevel: writer,
|
||||
// log.FatalLevel: writer,
|
||||
//}))
|
||||
|
||||
level := viper.GetString(config.LogLevel)
|
||||
|
||||
Reference in New Issue
Block a user