Perhaps implement your own subclass of LoggingAdapter, and override the mdc
method?

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

> Patrik thanx for replying.
> If I do not have a actor context because I am in a async code block of a
> HttpApp... how can I plug into the  DiagnosticLoggingAdapter
> <http://doc.akka.io/docs/akka/2.4.0-RC3/scala/logging.html#MDC_values_defined_by_the_application>
>  ?
> Am Freitag, 25. September 2015 16:38:06 UTC+2 schrieb Patrik Nordwall:
>>
>> The Akka logging is asynchronous and that is why you see the line number
>> of the akka.event.slf4j.Slf4jLogger instead of your own source code. It
>> would hurt performance too much to capture line number in the akka logging
>> in general but one idea of how you could add it yourself is that you use
>> the DiagnosticLoggingAdapter
>> <http://doc.akka.io/docs/akka/2.4.0-RC3/scala/logging.html#MDC_values_defined_by_the_application>
>> and put the source location into MDC.
>>
>> Regards,
>> Patrik
>>
>> On Wed, Sep 23, 2015 at 11:27 AM, <[email protected]> wrote:
>>
>>> my log4j 1.2 ConversionPattern is  [%l]
>>>
>>>
>>> Am Mittwoch, 23. September 2015 11:10:22 UTC+2 schrieb
>>> [email protected]:
>>>>
>>>> When using the akka.event.slf4j.Slf4jLogger and log4j  I find for the
>>>> location something like:
>>>>
>>>>
>>>> "akka.event.slf4j.Slf4jLogger$$anonfun$receive$1$$anonfun$applyOrElse$3.apply$mcV$sp(Slf4jLogger.scala:74)
>>>>
>>>> Is it possible to get the correct Sorce Code Line Number in the logs?
>>>>
>>>> --
>>> >>>>>>>>>> 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.
>



-- 

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