|
| 1 | +package com.netflix.conductor.common.config; |
| 2 | + |
| 3 | +import org.slf4j.Logger; |
| 4 | +import org.slf4j.LoggerFactory; |
| 5 | +import org.springframework.boot.context.event.ApplicationReadyEvent; |
| 6 | +import org.springframework.context.event.EventListener; |
| 7 | +import org.springframework.core.env.Environment; |
| 8 | +import org.springframework.stereotype.Component; |
| 9 | + |
| 10 | +@Component |
| 11 | +public class ConductorRedisPropLogger { |
| 12 | + |
| 13 | + private static final Logger LOGGER = LoggerFactory.getLogger(ConductorRedisPropLogger.class); |
| 14 | + |
| 15 | + private final Environment env; |
| 16 | + |
| 17 | + public ConductorRedisPropLogger(Environment env) { |
| 18 | + this.env = env; |
| 19 | + } |
| 20 | + |
| 21 | + @EventListener(ApplicationReadyEvent.class) |
| 22 | + public void loggerResolvedRedisProps() { |
| 23 | + // QUEUE (Orkes RedisQueueConfiguration) |
| 24 | + LOGGER.info("[CONDUCTOR_REDIS_UPGRADE] ==== QUEUE_CFG (Orkes queues) ===="); |
| 25 | + loggerKey("conductor.queue.type"); |
| 26 | + // common keys for Orkes redis queues: |
| 27 | + loggerKey("conductor.redis.hosts"); |
| 28 | + loggerKey("conductor.redis.ssl"); |
| 29 | + loggerKey("conductor.redis.workflowNamespacePrefix"); |
| 30 | + loggerKey("conductor.redis.queueNamespacePrefix"); |
| 31 | + LOGGER.info("[CONDUCTOR_REDIS_UPGRADE] =================================="); |
| 32 | + |
| 33 | + // LOCK (Netflix RedisLockConfiguration) |
| 34 | + LOGGER.info("[CONDUCTOR_REDIS_UPGRADE] ==== LOCK_CFG (Execution lock) ===="); |
| 35 | + loggerKey("conductor.workflow-scylla-execution-lock.enabled"); |
| 36 | + loggerKey("conductor.redis-lock.serverType"); |
| 37 | + loggerKey("conductor.redis-lock.serverAddress"); |
| 38 | + loggerKey("conductor.redis-lock.serverPassword"); |
| 39 | + loggerKey("conductor.redis-lock.namespace"); |
| 40 | + LOGGER.info("[CONDUCTOR_REDIS_UPGRADE] =================================="); |
| 41 | + } |
| 42 | + |
| 43 | + private void loggerKey(String key) { |
| 44 | + String val = env.getProperty(key); |
| 45 | + LOGGER.info("[CONDUCTOR_REDIS_UPGRADE] [{}] {}", key, val == null ? "<unset>" : val); |
| 46 | + } |
| 47 | +} |
0 commit comments