How can I silence logback?

1,716 views
Skip to first unread message

Theo

unread,
Nov 3, 2010, 3:32:35 PM11/3/10
to Akka User List
I'm completely new to Akka, so there may be something obvious I'm
missing here. When I run my super-simple test application (basically
just creating an actor, sending it a message and exiting) I get 20
lines of annoying messages from logback and Akka. Is there any simple
way of making them go away? They don't tell me anything useful, and
the output from my app is completely swamped.

I build the app with SBT and I've placed a logback.xml file so that
it's in the classpath when I "sbt run". It's basically identical to
Akka's logback.xml, but I set the log level of the akka package to
WARN (which doesn't seem to have much effect).

If I remove the logback.xml file I don't get any messages from
logback, but I get more messages from Akka (I get debug messages).

This is the output when running my app:

20:22:36,039 |-INFO in ch.qos.logback.classic.LoggerContext[default] -
Could NOT find resource [logback.groovy]
20:22:36,039 |-INFO in ch.qos.logback.classic.LoggerContext[default] -
Could NOT find resource [logback-test.xml]
20:22:36,039 |-INFO in ch.qos.logback.classic.LoggerContext[default] -
Found resource [logback.xml] at [file:/Users/theo/Documents/Code/
akkatest/config/logback.xml]
20:22:36,040 |-WARN in ch.qos.logback.classic.LoggerContext[default] -
Resource [logback.xml] occurs multiple times on the classpath.
20:22:36,041 |-WARN in ch.qos.logback.classic.LoggerContext[default] -
Resource [logback.xml] occurs at [file:/Users/theo/Documents/Code/
akkatest/config/logback.xml]
20:22:36,041 |-WARN in ch.qos.logback.classic.LoggerContext[default] -
Resource [logback.xml] occurs at [file:/Users/theo/Documents/Code/
akkatest/build/scala_2.8.0/resources/logback.xml]
20:22:36,214 |-INFO in
ch.qos.logback.classic.joran.action.ConfigurationAction - debug
attribute not set
20:22:36,219 |-INFO in ch.qos.logback.core.joran.action.AppenderAction
- About to instantiate appender of type
[ch.qos.logback.core.ConsoleAppender]
20:22:36,224 |-INFO in ch.qos.logback.core.joran.action.AppenderAction
- Naming appender as [stdout]
20:22:36,243 |-INFO in
ch.qos.logback.core.joran.action.NestedComplexPropertyIA - Assuming
default type [ch.qos.logback.classic.encoder.PatternLayoutEncoder] for
[encoder] property
20:22:36,243 |-INFO in
ch.qos.logback.core.joran.action.NestedComplexPropertyIA - Pushing
component [encoder] on top of the object stack.
20:22:36,296 |-INFO in
ch.qos.logback.classic.joran.action.LoggerAction - Setting level of
logger [akka] to WARN
20:22:36,296 |-INFO in
ch.qos.logback.classic.joran.action.LoggerAction - Setting additivity
of logger [akka] to true
20:22:36,296 |-INFO in
ch.qos.logback.classic.joran.action.RootLoggerAction - Setting level
of ROOT logger to DEBUG
20:22:36,296 |-INFO in
ch.qos.logback.core.joran.action.AppenderRefAction - Attaching
appender named [stdout] to Logger[ROOT]

INF [20101103-20:22:36.440] api: Initializing GlobalStmInstance using
factoryMethod 'org.multiverse.stms.alpha.AlphaStm.createFast'.
INF [20101103-20:22:36.455] alpha: Created a new AlphaStm instance
INF [20101103-20:22:36.455] api: Successfully initialized
GlobalStmInstance using factoryMethod
'org.multiverse.stms.alpha.AlphaStm.createFast'.

√iktor Klang

unread,
Nov 3, 2010, 3:43:53 PM11/3/10
to akka...@googlegroups.com
On Wed, Nov 3, 2010 at 8:32 PM, Theo <ico...@gmail.com> wrote:
I'm completely new to Akka, so there may be something obvious I'm
missing here. When I run my super-simple test application (basically
just creating an actor, sending it a message and exiting) I get 20
lines of annoying messages from logback and Akka. Is there any simple
way of making them go away? They don't tell me anything useful, and
the output from my app is completely swamped.


You're not telling us how you're running your application.

If you run it in the microkernel, you can just edit the logback.xml file in /config and set the log level to WARN for akka.

If you want to make sure that logback is using a custom config file,
specify:

java -Dlogback.configurationFile=/path/to/config.xml chapters.configuration.MyApp1

when you run it.

Here's the link to the logback docs:

http://logback.qos.ch/manual/configuration.html



Does that help?

Cheers,

 

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




--
Viktor Klang,
Code Connoisseur
Work:   Scalable Solutions
Code:   github.com/viktorklang
Follow: twitter.com/viktorklang
Read:   klangism.tumblr.com

Irmo Manie

unread,
Nov 3, 2010, 4:01:55 PM11/3/10
to akka...@googlegroups.com
What I figured out is that from within sbt the logback-test.xml is
used. Try editing that one to a silence mode :)

√iktor Klang

unread,
Nov 3, 2010, 5:17:33 PM11/3/10
to akka...@googlegroups.com
On Wed, Nov 3, 2010 at 9:01 PM, Irmo Manie <irmo....@gmail.com> wrote:
What I figured out is that from within sbt the logback-test.xml is
used. Try editing that one to a silence mode :)

The logback-test.xml shouldn't be in the dist, and if the users project is depending on Akka, no logback-test.xml should be present in the deps.
As I said earlier, it really helps if I know what environment/context it's used in. But that information is good for all people hacking on Akka itself :-)
 

Theo

unread,
Nov 4, 2010, 3:36:03 AM11/4/10
to Akka User List
I'm running the app with "sbt run" (which I mentioned), and the output
clearly states that logback does not find logback.groovy, logback-
test.xml, but that it finds logback.xml.

I managed to figure out that the problem was that it found multiple
configuration files (it was the same file that had been copied to
multiple locations by sbt, mostly because I had fiddled too much with
the settings), now logback is silent. however I still see these
messages (seems to be from some dependency of akka):

INF [20101104-08:29:56.829] api: Initializing GlobalStmInstance using
factoryMethod 'org.multiverse.stms.alpha.AlphaStm.createFast'.
INF [20101104-08:29:56.843] alpha: Created a new AlphaStm instance
INF [20101104-08:29:56.844] api: Successfully initialized
GlobalStmInstance using factoryMethod
'org.multiverse.stms.alpha.AlphaStm.createFast'.

the log format does not match the format in the logback config, so I
assume that this library uses some other logging framework. does
anyone know which, or how to make it log through logback so that I can
tell it to keep quiet?

just to show that it's definitely not going through logback, here's
the output if I set akka's log level to INFO:

[INFO] [2010-11-04 08:34:29,124] [run-main] a.c.ConfigLogger$: Config
[akka.conf] loaded from the application classpath.
INF [20101104-08:34:29.229] api: Initializing GlobalStmInstance using
factoryMethod 'org.multiverse.stms.alpha.AlphaStm.createFast'.
INF [20101104-08:34:29.240] alpha: Created a new AlphaStm instance
INF [20101104-08:34:29.241] api: Successfully initialized
GlobalStmInstance using factoryMethod
'org.multiverse.stms.alpha.AlphaStm.createFast'.

and adding <logger name="org.multiverse" level="WARN"/> to logback.xml
does not work.

T#

On Nov 3, 10:17 pm, √iktor Klang <viktor.kl...@gmail.com> wrote:
> On Wed, Nov 3, 2010 at 9:01 PM, Irmo Manie <irmo.ma...@gmail.com> wrote:
> > What I figured out is that from within sbt the logback-test.xml is
> > used. Try editing that one to a silence mode :)
>
> The logback-test.xml shouldn't be in the dist, and if the users project is
> depending on Akka, no logback-test.xml should be present in the deps.
> As I said earlier, it really helps if I know what environment/context it's
> used in. But that information is good for all people hacking on Akka itself
> :-)
>
>
>
>
>
>
>
> > On Wed, Nov 3, 2010 at 8:43 PM, √iktor Klang <viktor.kl...@gmail.com>
> > wrote:
> > >> akka-user+...@googlegroups.com<akka-user%2Bunsubscribe@googlegroups .com>
> > .
> > >> For more options, visit this group at
> > >>http://groups.google.com/group/akka-user?hl=en.
>
> > > --
> > > Viktor Klang,
> > > Code Connoisseur
> > > Work:   Scalable Solutions
> > > Code:   github.com/viktorklang
> > > Follow: twitter.com/viktorklang
> > > Read:   klangism.tumblr.com
>
> > > --
> > > 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<akka-user%2Bunsubscribe@googlegroups .com>
> > .
> > > For more options, visit this group at
> > >http://groups.google.com/group/akka-user?hl=en.
>
> > --
> > 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<akka-user%2Bunsubscribe@googlegroups .com>
> > .
> > For more options, visit this group at
> >http://groups.google.com/group/akka-user?hl=en.
>
> --
> Viktor Klang,
> Code Connoisseur
> Work:   Scalable Solutions <http://www.scalablesolutions.se>

Jonas Bonér

unread,
Nov 5, 2010, 4:11:32 AM11/5/10
to akka...@googlegroups.com
That is from Multiverse which is using Java Util Logging.
--
Jonas Bonér
Specialist at Large
work: http://scalablesolutions.se
code: http://akka.io
twtr: @jboner

"Theo" <ico...@gmail.com> wrote:

>To unsubscribe from this group, send email to akka-user+...@googlegroups.com.

Reply all
Reply to author
Forward
0 new messages