Akka logging adaptor doesn't support slf4j's trace level?

742 views
Skip to first unread message

Antony Stubbs

unread,
Dec 21, 2012, 1:43:58 PM12/21/12
to akka...@googlegroups.com
It looks like Akka logging adaptor doesn't support slf4j's trace level, is this the case? And if so, why is that?

I'm a little surprised that the akka logger isn't an actually implementation of slf4j interfaces...

Patrik Nordwall

unread,
Dec 21, 2012, 4:26:43 PM12/21/12
to akka...@googlegroups.com
Hi Antony,

On Fri, Dec 21, 2012 at 7:43 PM, Antony Stubbs <antony...@gmail.com> wrote:
It looks like Akka logging adaptor doesn't support slf4j's trace level, is this the case? And if so, why is that?

Yes, that is the case. Can you describe when/why you need a lower log level than debug?
 

I'm a little surprised that the akka logger isn't an actually implementation of slf4j interfaces...

It mostly originates in a zero dependency policy for akka-actor.

/Patrik 

--
>>>>>>>>>> Read the docs: http://akka.io/docs/
>>>>>>>>>> Check the FAQ: http://akka.io/faq/
>>>>>>>>>> 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 post to this group, send email to akka...@googlegroups.com.
To unsubscribe from this group, send email to akka-user+...@googlegroups.com.
Visit this group at http://groups.google.com/group/akka-user?hl=en.
 
 



--

Patrik Nordwall
Typesafe The software stack for applications that scale
Twitter: @patriknw

Antony Stubbs

unread,
Dec 21, 2012, 4:34:56 PM12/21/12
to akka...@googlegroups.com
I don't usually use it. But today I had a desire. I have debug output to print details of a very busy trafficked web server. But, I would like to dump the raw request - no matter how large - to trace level. 
Of course, it's not a need. 
My workaround was to also setup an slf4j logger and trace dump to that synchronously. 

Slf4j is pretty accepted now, I'm surprised akka's logging doesn't use it. 

Patrik Nordwall

unread,
Dec 21, 2012, 4:41:43 PM12/21/12
to akka...@googlegroups.com
Please add a ticket if you think it's important.
Thanks
/Patrik

Roland Kuhn

unread,
Dec 21, 2012, 4:48:40 PM12/21/12
to akka...@googlegroups.com
Hi Antony,

21 dec 2012 kl. 22:34 skrev Antony Stubbs:

I don't usually use it. But today I had a desire. I have debug output to print details of a very busy trafficked web server. But, I would like to dump the raw request - no matter how large - to trace level. 
Of course, it's not a need. 
My workaround was to also setup an slf4j logger and trace dump to that synchronously. 

Slf4j is pretty accepted now, I'm surprised akka's logging doesn't use it. 

There are enough people who want to use Akka and some other logging system, which is why Akka itself leaves your choices completely open. That is one of the differences between a framework and a toolkit. Akka’s built-in logging does not need a TRACE level and it can trivially be mapped onto slf4j (which is why there is a module for it out of the box); you are free to use whatever you want in your application. And implementing your own logging adapter is really trivial, just have a look at https://github.com/akka/akka/blob/master/akka-slf4j/src/main/scala/akka/event/slf4j/Slf4jEventHandler.scala. You can also add a TRACE level this way, by introducing a new channel on the EventStream.

Regards,

Roland



Dr. Roland Kuhn
Akka Tech Lead
Typesafe – The software stack for applications that scale.
twitter: @rolandkuhn

Antony Stubbs

unread,
Dec 21, 2012, 5:04:47 PM12/21/12
to akka...@googlegroups.com
Cool, thanks! I might submit a patch ;)

Eugene Dzhurinsky

unread,
May 8, 2014, 7:43:16 PM5/8/14
to akka...@googlegroups.com, antony...@gmail.com
Hello, all!

Is there any update on this topic, like - was this log level implemented in Akka slf4j bridge?

As far as I can see, no - so what's the status?

Thanks!

Roland Kuhn

unread,
May 9, 2014, 1:29:48 AM5/9/14
to akka-user
Hi Eugene,


In short, within Akka I don’t see a reason to introduce it, but you can easily use implicit classes to enable `log.trace(...)` and create your own Slf4jLoggingAdapter (by copying the Akka one and adding one line).

Regards,

Roland

--
>>>>>>>>>> Read the docs: http://akka.io/docs/

>>>>>>>>>> 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 akka-user+...@googlegroups.com.

To post to this group, send email to akka...@googlegroups.com.


Dr. Roland Kuhn
Akka Tech Lead
Typesafe – Reactive apps on the JVM.
twitter: @rolandkuhn


Colin Smith

unread,
Oct 9, 2015, 8:17:28 AM10/9/15
to Akka User List
I too find myself wanting log.trace(), and don't see a reason not to introduce it.

When trace logging is enabled one doesn't expect fantastic performance, but the insights that a deeper-than-debug level of logging might provide.

My use-case is that I want to see all the metric data that is being reported by my application to new relic, not just how many metrics, as the debug level currently provides.


Only trace should provide this level of detail.

I would expect any framework that wraps a logging implementation should provide this functionality, it is essential. Why not make it easy for your users and provide the Slf4jLoggingAdapter complete with trace?

Heiko Seeberger

unread,
Oct 9, 2015, 10:02:13 AM10/9/15
to akka...@googlegroups.com
I disagree. Akka's logging facility doesn’t wrap SLF4J, it just offers a backend based on SLF4J, like akka-log4j provides a backend based on Log4j 2. Personally, I don’t like too many levels and I believe the ones provided by Akka are perfect.

Just my 5 cents
Heiko

--

Heiko Seeberger
Twitter: @hseeberger

Eugene Dzhurinsky

unread,
Oct 9, 2015, 10:10:13 AM10/9/15
to akka...@googlegroups.com
On Fri, Oct 09, 2015 at 04:02:00PM +0200, Heiko Seeberger wrote:
> I disagree. Akka's logging facility doesn’t wrap SLF4J, it just offers a backend based on SLF4J, like akka-log4j provides a backend based on Log4j 2. Personally, I don’t like too many levels and I believe the ones provided by Akka are perfect.

I would say that restricting the functionality of logging frameworks in Akka
to some predefined set of levels - forces me to always prefer SLF4J over Akka
logging. If they are so strict about hard-coded log methods - okay, but
having at least some method in Akka logger that allows to pass a custom log
level (of type Any) to a back-end service of the actual logging system would
improve usability of that logging.

--
Eugene N Dzhurinsky
signature.asc

Heiko Seeberger

unread,
Oct 9, 2015, 10:19:44 AM10/9/15
to akka...@googlegroups.com
If you want to bypass Akka Logging, you maybe want to consider using Log4j with async logging, because its Disruptor based impl seems pretty neat. Maybe in Akka 3 they should get rid of Akka Logging altogether and use async Log4j logging directly?

Heiko

--

Heiko Seeberger
Twitter: @hseeberger

On 09 Oct 2015, at 16:18, Heiko Seeberger <ma...@heikoseeberger.de> wrote:

If you want to bypass Akka Logging, you maybe want to consider using Log4j with async logging, because its Disruptor based impl seems pretty neat. Maybe in Akka 3 they should get rid of Akka Logging altogether and use async Log4j logging directly?

Heiko

--

Heiko Seeberger
Twitter: @hseeberger

Reply all
Reply to author
Forward
0 new messages