[Typed] The logger name of logs that an entity wrote is not the entity class name
negokaz opened this issue · comments
Kazuki Negoro commented
I have confirmed that this is not the logger name expected with lerna-stack/akka-entity-replication-sample
- Expected:
BankAccountBehavior
- Actual:
Recovering
log output:
node3_1 | 06:49:13.598 INFO Recovering - [LEADER] Deposited(1623912553193,100) [balance: 1500, resent-transactions: 15]
Kazuki Negoro commented
We can resolve this with ActorContext.setLoggerName
defsetLoggerName(clazz: Class[_]): Unit
Implementation example
Behaviors.setup { context =>
context.setLoggerName(BankAccountBehavior.getClass)
ReplicatedEntityBehavior[Command, DomainEvent, Account](
Log output
node1_1 | 09:21:16.455 INFO BankAccountBehavior$ - [LEADER] Deposited(1623921676060,100) [balance: 8500, resent-transactions: 30]