add logging
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
aovantsev
2025-10-08 21:00:23 +03:00
parent e2cf730474
commit 4ae5bf6a81
9 changed files with 154 additions and 32 deletions

View File

@@ -26,6 +26,8 @@ type Config struct {
GinMode string
LogLevel string
Debug bool
LogDir string
LogVolume string
}
// LoadConfig loads configuration with proper environment file precedence
@@ -46,6 +48,8 @@ func LoadConfig() *Config {
GinMode: getGinMode(env),
LogLevel: getLogLevel(env),
Debug: env == Development,
LogDir: getEnv("LOG_DIR", "/app/logs"),
LogVolume: getEnv("LOG_VOLUME", "counter_logs"),
}
// Log configuration (without sensitive data)
@@ -183,6 +187,8 @@ func logConfig(config *Config) {
log.Printf("║ 📊 LOG LEVEL: %-15s ║", config.LogLevel)
log.Printf("║ 🌐 PORT: %-20s ║", config.Port)
log.Printf("║ 📈 METRICS PORT: %-15s ║", config.MetricsPort)
log.Printf("║ 📝 LOG DIR: %-20s ║", config.LogDir)
log.Printf("║ 📦 LOG VOLUME: %-18s ║", config.LogVolume)
log.Printf("║ ║")
log.Printf("║ 📁 Configuration Files Loaded: ║")
log.Printf("║ • .env (base configuration) ║")