import org.onap.dcae.collectors.veshv.model.ClientContextLogging.info
import org.onap.dcae.collectors.veshv.model.ClientContextLogging.debug
import org.onap.dcae.collectors.veshv.model.ClientContextLogging.withWarn
+import org.onap.dcae.collectors.veshv.utils.logging.Marker
import org.onap.dcae.collectors.veshv.model.ServerConfiguration
import org.onap.dcae.collectors.veshv.ssl.boundary.ServerSslContextFactory
import org.onap.dcae.collectors.veshv.utils.NettyServerHandle
clientContext.clientAddress = it.address()
}
+ logger.debug(clientContext::asMap, Marker.ENTRY) { "Client connection request received" }
return collectorProvider(clientContext).fold(
{
logger.warn(clientContext::asMap) { "Collector not ready. Closing connection..." }
Mono.empty()
},
{
- logger.info { "Handling new connection" }
+ logger.info(clientContext::asMap) { "Handling new connection" }
nettyInbound.withConnection { conn ->
conn.configureIdleTimeout(clientContext, serverConfig.idleTimeout)
.logConnectionClosed(clientContext)
private fun Connection.disconnectClient(ctx: ClientContext) {
channel().close().addListener {
+ logger.debug(ctx::asMap, Marker.EXIT) { "Closing client channel." }
if (it.isSuccess)
logger.debug(ctx) { "Channel closed successfully." }
else
private fun Connection.logConnectionClosed(ctx: ClientContext): Connection {
onTerminate().subscribe {
- logger.info(ctx) { "Connection has been closed" }
+ // TODO: this code is never executed (at least with ssl-enabled, did not checked with ssl-disabled)
+ logger.info(ctx::asMap, Marker.EXIT) { "Connection has been closed" }
}
return this
}