Skip to content

Commit

Permalink
Dont try logging to a file
Browse files Browse the repository at this point in the history
  • Loading branch information
4censord committed Oct 12, 2024
1 parent 32e2f56 commit b62a6fb
Showing 1 changed file with 0 additions and 12 deletions.
12 changes: 0 additions & 12 deletions main.go
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
package main

import (
log2 "log"
"net/http"
"os"
"path/filepath"
"time"

"github.com/NYTimes/logrotate"
"github.com/apex/log"
"github.com/apex/log/handlers/cli"
"github.com/apex/log/handlers/multi"
Expand All @@ -20,15 +17,6 @@ import (
// 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.
func initLogging() {
dir := config.Get().System.LogDirectory
p := filepath.Join(dir, "/sftp-server.log")
if err := os.MkdirAll(filepath.Dir(p), 0o755); err != nil {
log2.Fatalf("sftp: could not create internal sftp server log directory: %s", err)
}
w, err := logrotate.NewFile(p)
if err != nil {
log2.Fatalf("failed to create server log: %s", err)
}
log.SetLevel(log.InfoLevel)
if config.Get().Debug {
log.SetLevel(log.DebugLevel)
Expand Down

0 comments on commit b62a6fb

Please sign in to comment.