Merge pull request #51 from pterodactyl/fix/2257

Fix log directory not being created
This commit is contained in:
Dane Everitt 2020-08-24 19:08:12 -07:00 committed by GitHub
commit 9cd416611f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 5 deletions

View File

@ -337,6 +337,10 @@ func Execute() error {
// Configures the global logger for Zap so that we can call it from any location // Configures the global logger for Zap so that we can call it from any location
// in the code without having to pass around a logger instance. // in the code without having to pass around a logger instance.
func configureLogging(logDir string, debug bool) error { func configureLogging(logDir string, debug bool) error {
if err := os.MkdirAll(path.Join(config.Get().System.LogDirectory, "/install"), 0700); err != nil {
return errors.WithStack(err)
}
cfg := zap.NewProductionConfig() cfg := zap.NewProductionConfig()
if debug { if debug {
cfg = zap.NewDevelopmentConfig() cfg = zap.NewDevelopmentConfig()

View File

@ -49,11 +49,6 @@ func (sc *SystemConfiguration) ConfigureDirectories() error {
return err return err
} }
log.WithField("path", sc.LogDirectory).Debug("ensuring log directory exists")
if err := os.MkdirAll(path.Join(sc.LogDirectory, "/install"), 0700); err != nil {
return err
}
log.WithField("path", sc.Data).Debug("ensuring server data directory exists") log.WithField("path", sc.Data).Debug("ensuring server data directory exists")
if err := os.MkdirAll(sc.Data, 0700); err != nil { if err := os.MkdirAll(sc.Data, 0700); err != nil {
return err return err