You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by Stu Hood <st...@webmail.us> on 2007/08/01 17:10:20 UTC
Logging in Solr Embedded
Hello,
I've been using Solr in an embedded situation, and its been working quite well. But as I've started scaling up the application, the logging that Solr does to stderr is getting excessive.
I'd like to disable the INFO messages, and leave the WARNINGs. According to the Java API I should be able to use `SolrCore.log.setLevel(Level.WARNING)`, but that doesn't seem to stem the tide. Neither does `Config.log.setLevel(Level.WARNING)`.
Is there another log object that I've missed?
Thanks!
Stu Hood
Webmail.us
"You manage your business. We'll manage your email."®
Re: Logging in Solr Embedded
Posted by Yonik Seeley <yo...@apache.org>.
On 8/1/07, Stu Hood <st...@webmail.us> wrote:
> I've been using Solr in an embedded situation, and its been working quite well. But as I've started scaling up the application, the logging that Solr does to stderr is getting excessive.
>
> I'd like to disable the INFO messages, and leave the WARNINGs. According to the Java API I should be able to use `SolrCore.log.setLevel(Level.WARNING)`, but that doesn't seem to stem the tide. Neither does `Config.log.setLevel(Level.WARNING)`.
>
> Is there another log object that I've missed?
You can change the log levels from an external properties file, and
programatically with something like this:
Logger logg;
log = Logger.getLogger("");
log.log(Level.INFO, "Changing log level to SEVERE");
log.setLevel(Level.SEVERE);
That will set to SEVERE for all classes.
If you just want loggers under org.apache.solr, you can do something like this:
log = Logger.getLogger("org.apache.solr");
log.setUseParentHandlers(false);
But you might have to also set your own handler in order to get any
output (not sure about that point).
-Yonik
RE: Logging in Solr Embedded
Posted by Teruhiko Kurosaka <Ku...@basistech.com>.
I think it's best to control log level by an external file; you don't
want to
reprogram when you need log.
Define the system property java.util.logging.config.file to point to
your
log properties file. I would copy
$JAVA_HOME/jre/lib/logging.properties and then add a line:
org.apache.solr.level = WARNING
See
http://java.sun.com/javase/6/docs/api/index.html
and
http://java.sun.com/j2se/1.4.2/docs/guide/util/logging/overview.html
for details.
-kuro
> -----Original Message-----
> From: Stu Hood [mailto:stuhood@webmail.us]
> Sent: Wednesday, August 01, 2007 8:10 AM
> To: solr-user@lucene.apache.org
> Subject: Logging in Solr Embedded
>
>
>
> Hello,
>
> I've been using Solr in an embedded situation, and its been
> working quite well. But as I've started scaling up the
> application, the logging that Solr does to stderr is getting
> excessive.
>
> I'd like to disable the INFO messages, and leave the
> WARNINGs. According to the Java API I should be able to use
> `SolrCore.log.setLevel(Level.WARNING)`, but that doesn't seem
> to stem the tide. Neither does `Config.log.setLevel(Level.WARNING)`.
>
> Is there another log object that I've missed?
>
> Thanks!
>
> Stu Hood
> Webmail.us
> "You manage your business. We'll manage your email."(r)
>