diff --git a/core/task/log/file_driver.go b/core/task/log/file_driver.go index 57d33d91..ac5367e3 100644 --- a/core/task/log/file_driver.go +++ b/core/task/log/file_driver.go @@ -237,7 +237,7 @@ func (d *FileLogDriver) cleanup() { if !utils.Exists(utils.GetTaskLogPath()) { // create log directory if not exists if err := os.MkdirAll(utils.GetTaskLogPath(), os.FileMode(0770)); err != nil { - d.Errorf("failed to create log directory: %s", utils.GetTaskLogPath()) + d.Errorf("failed to create log directory: %s. error: %v", utils.GetTaskLogPath(), err) return } } @@ -249,13 +249,13 @@ func (d *FileLogDriver) cleanup() { case <-ticker.C: dirs, err := utils.ListDir(utils.GetTaskLogPath()) if err != nil { - d.Errorf("failed to list log directory: %s", utils.GetTaskLogPath()) + d.Errorf("failed to list log directory: %s. error: %v", utils.GetTaskLogPath(), err) continue } for _, dir := range dirs { if time.Now().After(dir.ModTime().Add(d.getTtl())) { if err := os.RemoveAll(d.getBasePath(dir.Name())); err != nil { - d.Errorf("failed to remove outdated log directory: %s", d.getBasePath(dir.Name())) + d.Errorf("failed to remove outdated log directory: %s. error: %s", d.getBasePath(dir.Name()), err) continue } d.Infof("removed outdated log directory: %s", d.getBasePath(dir.Name())) diff --git a/core/utils/config.go b/core/utils/config.go index d8dfbe2c..3387ff65 100644 --- a/core/utils/config.go +++ b/core/utils/config.go @@ -11,7 +11,7 @@ import ( const ( DefaultWorkspace = "crawlab_workspace" - DefaultTaskLogPath = "/app/logs/tasks" + DefaultTaskLogPath = "/var/log/crawlab/tasks" DefaultServerHost = "0.0.0.0" DefaultServerPort = 8000 DefaultGrpcHost = "localhost"