You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by Elliotte Harold <er...@gmail.com> on 2007/06/13 16:13:49 UTC

Disabling System.err logging

I'm starting a JMS application using test first development, as is my habit.
As soon as I run the first test, it's dumping a lot of junk like this to the
console:

Jun 13, 2007 10:07:06 AM org.apache.activemq.broker.BrokerService getBroker
INFO: ActiveMQ 4.1.1 JMS Message Broker (localhost) is starting
Jun 13, 2007 10:07:06 AM org.apache.activemq.broker.BrokerService getBroker
INFO: For help or more information please see:
http://incubator.apache.org/activemq/
Jun 13, 2007 10:07:06 AM org.apache.activemq.broker.jmx.ManagementContext$1run
INFO: JMX consoles can connect to
service:jmx:rmi:///jndi/rmi://localhost:1099/jmxrmi
Jun 13, 2007 10:07:06 AM org.apache.activemq.broker.BrokerService start
...

1. How do I turn this off (short of redirecting System.err to /dev/null,
which I can do if I have to)

2. Shouldn't this be off by default? I didn't ask for this output, and
libraries should not talk to the end user unless the client specifically
tells them to.

-- 
Elliotte Rusty Harold
erharold@gmail.com

Re: Disabling System.err logging

Posted by James Strachan <ja...@gmail.com>.
On 6/13/07, Elliotte Harold <er...@gmail.com> wrote:
> On 6/13/07, James Strachan <ja...@gmail.com> wrote:
> >
> > On 6/13/07, Elliotte Harold <er...@gmail.com> wrote:
> > > I'm starting a JMS application using test first development, as is my
> > habit.
> >
> > > 1. How do I turn this off (short of redirecting System.err to /dev/null,
> > > which I can do if I have to)
> >
> > You can disable it via adding this to the conf/log4j.properties file
> > to disable all INFO level logging for activemq...
> >
> > log4j.logger.org.apache.activemq=WARN
>
>
> Where should I put that relative to my project's classpath? I've added the
> activemq jar and other jars I seem to need to my lib directory. Where does
> conf/log4j.properties go?

Sorry - I thought you were running the activemq script to boot up the broker.

If you are inside your own project, add a directory to the classpath
and put log4j.properties in there (taking the one from
activemq/conf/log4j.properties from the binary distro). Or if you are
in a WAR pop it in WEB-INF/classes


> Also, I've only added commons-logging-1.2.1.jar to my classpath. I have not
> added log4j yet, so is this really accurate? Something's logging, but I'm
> not sure it's log4j.

Its gonna be easier to add log4j. If not you need to muck with the
commons-logging system properties...
http://jakarta.apache.org/commons/logging/commons-logging-1.1/guide.html#Configuration

-- 
James
-------
http://macstrac.blogspot.com/

Re: Disabling System.err logging

Posted by Elliotte Harold <er...@gmail.com>.
On 6/13/07, James Strachan <ja...@gmail.com> wrote:
>
> On 6/13/07, Elliotte Harold <er...@gmail.com> wrote:
> > I'm starting a JMS application using test first development, as is my
> habit.
>
> > 1. How do I turn this off (short of redirecting System.err to /dev/null,
> > which I can do if I have to)
>
> You can disable it via adding this to the conf/log4j.properties file
> to disable all INFO level logging for activemq...
>
> log4j.logger.org.apache.activemq=WARN


Where should I put that relative to my project's classpath? I've added the
activemq jar and other jars I seem to need to my lib directory. Where does
conf/log4j.properties go?

Also, I've only added commons-logging-1.2.1.jar to my classpath. I have not
added log4j yet, so is this really accurate? Something's logging, but I'm
not sure it's log4j.

-- 
Elliotte Rusty Harold
erharold@gmail.com

Re: Disabling System.err logging

Posted by James Strachan <ja...@gmail.com>.
On 6/13/07, Elliotte Harold <er...@gmail.com> wrote:
> I'm starting a JMS application using test first development, as is my habit.
> As soon as I run the first test, it's dumping a lot of junk like this to the
> console:
>
> Jun 13, 2007 10:07:06 AM org.apache.activemq.broker.BrokerService getBroker
> INFO: ActiveMQ 4.1.1 JMS Message Broker (localhost) is starting
> Jun 13, 2007 10:07:06 AM org.apache.activemq.broker.BrokerService getBroker
> INFO: For help or more information please see:
> http://incubator.apache.org/activemq/
> Jun 13, 2007 10:07:06 AM org.apache.activemq.broker.jmx.ManagementContext$1run
> INFO: JMX consoles can connect to
> service:jmx:rmi:///jndi/rmi://localhost:1099/jmxrmi
> Jun 13, 2007 10:07:06 AM org.apache.activemq.broker.BrokerService start
> ...
>
> 1. How do I turn this off (short of redirecting System.err to /dev/null,
> which I can do if I have to)

You can disable it via adding this to the conf/log4j.properties file
to disable all INFO level logging for activemq...

log4j.logger.org.apache.activemq=WARN


or change this line

log4j.rootLogger=INFO, stdout, out

to

log4j.rootLogger=INFO, out

to disable stdout



> 2. Shouldn't this be off by default? I didn't ask for this output, and
> libraries should not talk to the end user unless the client specifically
> tells them to.

Mostly as any kind of problem folks mail to the user list, we need to
know what version folks are using; so thats the first thing we log (as
with classloader issues, sometimes its not what folks think it is).

Then often the second question we get is how to connect remotely via
JMX; so we log that URL.

So there's a small few bits of logging we tend to do that makes it
easy for users to get good answers on the forums. Its also easy to
disable if folks don't want it.

-- 
James
-------
http://macstrac.blogspot.com/