slf4j Problem

1,277 views
Skip to first unread message

Kuhnen

unread,
Oct 10, 2011, 10:35:49 PM10/10/11
to Akka User List
Hello everybody.

Hello akka people, can you guys help me with that?

log4j:WARN No appenders could be found for logger
(akka.event.slf4j.Slf4jEventHandler).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig
for more info.

I want to use the slf4j logger but i keep getting this warning, and it
does not work.

I'm puting a actor.jar on the deploy directory. The Akka version is
1.1.2.
The defaulListener is working fine.


My akka.conf file:


event-handlers = ["akka.event.EventHandler$DefaultListener",
"akka.event.slf4j.Slf4jEventHandler"]
event-handler-level = "INFO"

My dependencies:


resolvers += "Typesafe Repository" at "http://repo.typesafe.com/
typesafe/releases"

{
val version = "1.1.2"
libraryDependencies ++= Seq("se.scalablesolutions.akka" % "akka-
actor" % version,
"se.scalablesolutions.akka" % "akka-remote" % version,
"se.scalablesolutions.akka" % "akka-slf4j" % version)
}


libraryDependencies += "ch.qos.logback" % "logback-classic" % "0.9.28"
% "runtime"


scala version = 2.9.1.

What am i missing?
Thanks a lot



Patrik Nordwall

unread,
Oct 11, 2011, 2:08:44 AM10/11/11
to akka...@googlegroups.com
On Tue, Oct 11, 2011 at 4:35 AM, Kuhnen <andre...@gmail.com> wrote:
Hello everybody.

Hello akka people, can you guys help me with that?

log4j:WARN No appenders could be found for logger
(akka.event.slf4j.Slf4jEventHandler).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig
for more info.

Somewhere log4j is used. Might be in your application or dependent libraries. You probably wan't to setup a log4j-to-sl4fj bridge.
Replacing the log4j.jar file with log4j-over-slf4j.jar.
Read all about it (and more) here: http://www.slf4j.org/legacy.html

Let us know if log4j is used in any of Akka's core dependencies.


I want to use the slf4j logger but i keep getting this warning, and it
does not work.

I'm puting a actor.jar on the deploy directory. The Akka version is
1.1.2.
The defaulListener is working fine.


My akka.conf file:


   event-handlers = ["akka.event.EventHandler$DefaultListener",
"akka.event.slf4j.Slf4jEventHandler"]
   event-handler-level = "INFO"

My dependencies:


resolvers += "Typesafe Repository" at "http://repo.typesafe.com/
typesafe/releases
"

{
 val version = "1.1.2"
 libraryDependencies ++= Seq("se.scalablesolutions.akka" % "akka-
actor" % version,
                                               "se.scalablesolutions.akka" % "akka-remote" % version,
                                               "se.scalablesolutions.akka" % "akka-slf4j" % version)
}


libraryDependencies += "ch.qos.logback" % "logback-classic" % "0.9.28"
% "runtime"


scala version = 2.9.1.

What am i missing?
Thanks a lot



--
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.
For more options, visit this group at http://groups.google.com/group/akka-user?hl=en.




--

Patrik Nordwall
Typesafe - Enterprise-Grade Scala from the Experts
Twitter: @patriknw


François Beausoleil

unread,
Oct 10, 2011, 10:49:39 PM10/10/11
to akka...@googlegroups.com

Le lundi 10 octobre 2011 à 22:35, Kuhnen a écrit :

Did you follow the link? You need a log4j.properties or log4j.xml at the root of the classpath.

Hope that helps,
François

Kuhnen

unread,
Oct 11, 2011, 3:04:33 PM10/11/11
to Akka User List
Thanks for the quick response.
François is right, if a put a log4j.xml file it does work, but the
logback.xml that comes with the akka 1.2 version does not work, and I
wonder why?
The log4f: WARN did not appear if I start the 1.1.3 version akka
microkernel.
Would that be a bug?

Just to keep things clear.
I downloaded the type-safe stack (akka version 1.2) and did not change
any file, besides the akka.conf to add the slf4j event handler.
It works fine if I put a log4j.xml file on the config directory, but
it does not read the logback.xml file (I guess)

By the way, Patrick, thanks for the advice, I will read that today.


On Oct 10, 11:49 pm, François Beausoleil
<francois.beausol...@gmail.com> wrote:
> Le lundi 10 octobre 2011 à 22:35, Kuhnen a écrit :
>
> > log4j:WARN Seehttp://logging.apache.org/log4j/1.2/faq.html#noconfig
Reply all
Reply to author
Forward
0 new messages