Skip to content

Commit

Permalink
JMS: use full name of stage in logs (#1339)
Browse files Browse the repository at this point in the history
Fixes #1338
  • Loading branch information
andreas-schroeder authored and ennru committed Nov 26, 2018
1 parent 81a11eb commit cc21fb7
Showing 1 changed file with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ trait JmsConnector[S <: JmsSession] {
case ex: jms.JMSSecurityException =>
log.error(ex,
"{} initializing connection failed, security settings are not properly configured",
attributes.nameOrDefault())
attributes.nameLifted.mkString)
publishAndFailStage(ex)

case _: jms.JMSException | _: JmsConnectTimedOut => handleRetriableException(ex)
Expand All @@ -112,7 +112,7 @@ trait JmsConnector[S <: JmsSession] {
connectionState match {
case _: JmsConnectorStopping | _: JmsConnectorStopped => logStoppingException(ex)
case _ =>
log.error(ex, "{} connection failed", attributes.nameOrDefault())
log.error(ex, "{} connection failed", attributes.nameLifted.mkString)
publishAndFailStage(ex)
}
}
Expand All @@ -130,7 +130,7 @@ trait JmsConnector[S <: JmsSession] {

private def logStoppingException(ex: Throwable): Unit =
log.info("{} caught exception {} while stopping stage: {}",
attributes.nameOrDefault(),
attributes.nameLifted.mkString,
ex.getClass.getSimpleName,
ex.getMessage)

Expand All @@ -146,7 +146,7 @@ trait JmsConnector[S <: JmsSession] {
if (sessions + 1 == jmsSettings.sessionCount) {
c.foreach { c =>
updateState(JmsConnectorConnected(c))
log.info("{} connected", attributes.nameOrDefault())
log.info("{} connected", attributes.nameLifted.mkString)
}
} else {
updateState(init.copy(sessions = sessions + 1))
Expand All @@ -163,7 +163,7 @@ trait JmsConnector[S <: JmsSession] {
}

case Failure(ex) =>
log.error(ex, "{} initializing connection failed", attributes.nameOrDefault())
log.error(ex, "{} initializing connection failed", attributes.nameLifted.mkString)
publishAndFailStage(ex)
}

Expand All @@ -177,7 +177,7 @@ trait JmsConnector[S <: JmsSession] {
val exception =
if (maxRetries == 0) ex
else ConnectionRetryException(s"Could not establish connection after $maxRetries retries.", ex)
log.error(exception, "{} initializing connection failed", attributes.nameOrDefault())
log.error(exception, "{} initializing connection failed", attributes.nameLifted.mkString)
publishAndFailStage(exception)
} else {
val status = updateState(JmsConnectorDisconnected)
Expand All @@ -190,7 +190,7 @@ trait JmsConnector[S <: JmsSession] {

override def onTimer(timerKey: Any): Unit = timerKey match {
case AttemptConnect(attempt, backoffMaxed) =>
log.info("{} retries connecting, attempt {}", attributes.nameOrDefault(), attempt)
log.info("{} retries connecting, attempt {}", attributes.nameLifted.mkString, attempt)
initSessionAsync(attempt, backoffMaxed)
case _ => ()
}
Expand Down

0 comments on commit cc21fb7

Please sign in to comment.