On 8/1/07, Stu Hood <[EMAIL PROTECTED]> 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

Reply via email to