>
> Hi √,
>
> I want to have MDC logging so I can organize my logs, for example
> according to requestId.
>
> I am tried out the example in
> http://doc.akka.io/docs/akka/2.3.10/scala/logging.html#MDC_values_defined_by_the_application.
>
> It works fine for a single actor, but If I'm sending a message to another
> Actor, the MDC values are not log on the other Actors.
>
> class RequestHandler() extends Actor with
> akka.actor.DiagnosticActorLogging{
>
> override def mdc(currentMessage: Any): MDC = {
> currentMessage match {
> case req: TypeA => Map("requestId" -> req.id)
> case _ => Map()
> }
> }
>
> def receive: Receive = {
> case req: TypeA =>
> log.debug("RECEIVE req typeA") //logged with
> correct "[requestId -> someRandom]"
> val actorA = context.ActorOf(ActorA.props)
> actorA ! req //logs in actorA
> are do not have value on requestId (how to log them?)
> }
> }
>
> class ActorA() extends Actor with akka.actor.DiagnosticActorLogging {...}
> //logs of helperActors called by ActorA are not also logged with correct
> requestId (how to log them?)
>
> Is it possible with AKKA MDC to log all codeLogs (including logs from
> dependency libs) for a certain requestId with correct MDC map values?
>
I also set akka logger to sl4fj on my application.conf
akka {
loggers = ["akka.event.slf4j.Slf4jLogger"]
logging-filter = "akka.event.slf4j.Slf4jLoggingFilter"
>
> On Monday, April 27, 2015 at 3:30:47 PM UTC+8, √ wrote:
> Hi Anindita,
>
> It would be great for us to know what is lacking in the MDC sections of
> the Akka Logging documentation,
> please don't hesitate to contribute.
>
> Thanks!
>
> On Mon, Apr 27, 2015 at 8:09 AM, Anindita Ghatak <[email protected]>
> wrote:
> Hi,
> How can I use Akka with org.apache.log4j.MDC ?
>
> Thanks & Regards,
> Anindita
> --
> >>>>>>>>>> Read the docs: http://akka.io/docs/
> >>>>>>>>>> Check the FAQ:
> http://doc.akka.io/docs/akka/current/additional/faq.html
> >>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user
> ---
> You received this message because you are subscribed to the Google Groups
> "Akka User List" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/akka-user.
>
> For more options, visit https://groups.google.com/d/optout.
>
>
>
> --
> Cheers,
> √
>
--
>>>>>>>>>> Read the docs: http://akka.io/docs/
>>>>>>>>>> Check the FAQ:
>>>>>>>>>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user
---
You received this message because you are subscribed to the Google Groups "Akka
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.