From 36d18ed23a5fea7bf55aa57f392e3158cd01b5a9 Mon Sep 17 00:00:00 2001 From: Michael Friedrich Date: Sat, 2 Nov 2019 15:43:58 +0100 Subject: [PATCH] IcingaDB: Log where we are connecting to --- lib/icingadb/redisconnection.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/icingadb/redisconnection.cpp b/lib/icingadb/redisconnection.cpp index 9a0078aef..c1d04b774 100644 --- a/lib/icingadb/redisconnection.cpp +++ b/lib/icingadb/redisconnection.cpp @@ -144,14 +144,18 @@ void RedisConnection::Connect(asio::yield_context& yc) { Defer notConnecting ([this]() { m_Connecting.store(m_Connected.load()); }); - Log(LogInformation, "IcingaDB", "Trying to connect to Redis server (async)"); - try { if (m_Path.IsEmpty()) { + Log(LogInformation, "IcingaDB") + << "Trying to connect to Redis server (async) on host '" << m_Host << ":" << m_Port << "'"; + decltype(m_TcpConn) conn (new TcpConn(m_Strand.context())); icinga::Connect(conn->next_layer(), m_Host, Convert::ToString(m_Port), yc); m_TcpConn = std::move(conn); } else { + Log(LogInformation, "IcingaDB") + << "Trying to connect to Redis server (async) on unix socket path '" << m_Path << "'"; + decltype(m_UnixConn) conn (new UnixConn(m_Strand.context())); conn->next_layer().async_connect(Unix::endpoint(m_Path.CStr()), yc); m_UnixConn = std::move(conn);