From ba45d71c088d852e6ba062b9c23b3a7cd0f7236f Mon Sep 17 00:00:00 2001 From: Yunkon Kim Date: Thu, 26 Sep 2024 11:52:27 +0900 Subject: [PATCH] Staging v0.2.2 --- README.md | 5 +++-- deployments/docker-compose/docker-compose.yaml | 2 +- pkg/logger/logger.go | 10 ++++++++++ 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 677150d..4a76be2 100644 --- a/README.md +++ b/README.md @@ -24,8 +24,9 @@ Computing Infrastructure Migration framework (codename: cm-beetle) is going to s ## How to run and use CM-Beetle -1. [How to run and use the CM-Beetle](https://github.com/cloud-barista/cm-beetle/discussions/73) -2. [How to deploy CM-Beetle, along with its related components](https://github.com/cloud-barista/cm-beetle/discussions/105) +1. [How to deploy CM-Beetle, along with its related components](https://github.com/cloud-barista/cm-beetle/discussions/105) + +Note - Deprecated, [How to run and use the CM-Beetle](https://github.com/cloud-barista/cm-beetle/discussions/73) --- diff --git a/deployments/docker-compose/docker-compose.yaml b/deployments/docker-compose/docker-compose.yaml index 8dc4370..bf29488 100644 --- a/deployments/docker-compose/docker-compose.yaml +++ b/deployments/docker-compose/docker-compose.yaml @@ -7,7 +7,7 @@ networks: services: # cm-beetle cm-beetle: - image: cloudbaristaorg/cm-beetle:0.2.1 + image: cloudbaristaorg/cm-beetle:0.2.2 container_name: cm-beetle pull_policy: missing build: diff --git a/pkg/logger/logger.go b/pkg/logger/logger.go index f7a96ba..4b18a75 100644 --- a/pkg/logger/logger.go +++ b/pkg/logger/logger.go @@ -102,6 +102,16 @@ func NewLogger(config Config) *zerolog.Logger { Compress: config.Compress, } + // Ensure the log file directory exists before creating the log file + dir := filepath.Dir(config.LogFilePath) + if _, err := os.Stat(dir); os.IsNotExist(err) { + // Create the directory if it does not exist + err = os.MkdirAll(dir, 0755) // Set permissions as needed + if err != nil { + log.Fatal().Msgf("Failed to create log directory: %v", err) + } + } + // Ensure the log file exists before changing its permissions if _, err := os.Stat(config.LogFilePath); os.IsNotExist(err) { // Create the log file if it does not exist