-
Notifications
You must be signed in to change notification settings - Fork 82
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Standarised the logging between the Baker implementations and added m…
…issing MDC information (#1447) * Made the AkkaBaker use the BakerLogging for logging Baker releated events. Added missing logs & corrected logs that where wrong. * Added the MetaData object also to the execute of the InteractionInstance. This can then be used inside of the implementation as a context for logging or similar use cases.
- Loading branch information
1 parent
b3ccb54
commit 79b51c5
Showing
26 changed files
with
259 additions
and
173 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
54 changes: 54 additions & 0 deletions
54
...kka-runtime/src/main/scala/com/ing/baker/runtime/akka/actor/logging/LogAndSendEvent.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
package com.ing.baker.runtime.akka.actor.logging | ||
|
||
import akka.event.EventStream | ||
import com.ing.baker.il.petrinet.Transition | ||
import com.ing.baker.runtime.common.{EventReceived, EventRejected, InteractionCompleted, InteractionFailed, InteractionStarted, RecipeAdded, RecipeInstanceCreated} | ||
import com.ing.baker.runtime.model.BakerLogging | ||
|
||
object LogAndSendEvent { | ||
|
||
val bakerLogging: BakerLogging = BakerLogging.default | ||
//TODO get this on startup instead of requiring for each call | ||
//val eventStream: EventStream = context.system.eventStream | ||
|
||
def recipeAdded(recipeAdded: RecipeAdded, eventStream: EventStream): Unit = { | ||
eventStream.publish(recipeAdded) | ||
bakerLogging.addedRecipe(recipeAdded) | ||
} | ||
|
||
def recipeInstanceCreated(recipeInstanceCreated: RecipeInstanceCreated, eventStream: EventStream): Unit = { | ||
eventStream.publish(recipeInstanceCreated) | ||
bakerLogging.recipeInstanceCreated(recipeInstanceCreated) | ||
} | ||
|
||
def interactionStarted(interactionStarted: InteractionStarted, eventStream: EventStream): Unit = { | ||
eventStream.publish(interactionStarted) | ||
bakerLogging.interactionStarted(interactionStarted) | ||
} | ||
|
||
def interactionCompleted(interactionCompleted: InteractionCompleted, eventStream: EventStream): Unit = { | ||
eventStream.publish(interactionCompleted) | ||
bakerLogging.interactionFinished(interactionCompleted) | ||
} | ||
|
||
def interactionFailed(interactionFailed: InteractionFailed, eventStream: EventStream): Unit = { | ||
eventStream.publish(interactionFailed) | ||
bakerLogging.interactionFailed(interactionFailed) | ||
} | ||
|
||
def eventReceived(eventReceived: EventReceived, eventStream: EventStream): Unit = { | ||
eventStream.publish(eventReceived) | ||
bakerLogging.eventReceived(eventReceived) | ||
} | ||
|
||
def eventRejected(eventRejected: EventRejected, eventStream: EventStream): Unit = { | ||
eventStream.publish(eventRejected) | ||
bakerLogging.eventRejected(eventRejected) | ||
} | ||
|
||
def firingEvent(recipeInstanceId: String, executionId: Long, transition: Transition, timeStarted: Long): Unit = { | ||
//TODO This does not have a corrosponding BakerEvent, this should be created | ||
bakerLogging.firingEvent(recipeInstanceId, executionId, transition, timeStarted) | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.