package main import ( "apiServer_service/utils/httplog" "apiServer_service/utils/logger" "fmt" "os" "os/signal" "syscall" "github.com/joho/godotenv" ) func init() { if err := godotenv.Load(".env"); err != nil { fmt.Println("Warning: .env file not found, using system environment variables") } } func main() { redisKey := os.Getenv("ES_REDIS_KEY") esIndexPrefix := os.Getenv("ES_INDEX_PREFIX") logger.Info("CLI", fmt.Sprintf("httplog 上报启动 (redis_key=%s, es_index=%s-*)", redisKey, esIndexPrefix)) go httplog.Updater(redisKey, esIndexPrefix) quit := make(chan os.Signal, 1) signal.Notify(quit, syscall.SIGINT, syscall.SIGTERM) <-quit logger.Info("CLI", "正在关闭...") }