The reason is that it's not thread safe (must not be accessed concurrently
from different threads).

I guess you can write your own class that is similar to
DiagnosticLoggingAdapter
but I don't know how do you intend to use it from futures. Passing context
(MDC) across threads is not easy.

https://github.com/akka/akka/blob/master/akka-actor/src/main/scala/akka/event/Logging.scala#L1133
https://github.com/akka/akka/blob/master/akka-actor/src/main/scala/akka/event/Logging.scala#L527

/Patrik

On Fri, Sep 25, 2015 at 3:44 PM, <[email protected]> wrote:

> Ok I now see from the docs that DiagnosticLoggingAdapter must be used
> within an actor.
> Hmmh a simple Logger won't work because I need to log from within futures.
> I am alittle affraid of using
>
> Logback *AsyncAppender because it might block.*
>
>
> Am Freitag, 25. September 2015 15:32:40 UTC+2 schrieb [email protected]:
>>
>> I wanted to use MDC and therefore a  DiagnosticLoggingAdapter in a class
>> that extends
>>
>> akka.http.javadsl.server.HttpApp
>>
>> But there seems to be no way to create such an DiagnosticLoggingAdapter 
>> outside of an Actor?
>>
>> Right now I guess I have to fallback to use a Logback *AsyncAppender*?
>>
>>
>> --
> >>>>>>>>>> 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.
>



-- 

Patrik Nordwall
Typesafe <http://typesafe.com/> -  Reactive apps on the JVM
Twitter: @patriknw

-- 
>>>>>>>>>>      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.

Reply via email to