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 solruser <so...@gmail.com> on 2007/07/12 03:07:59 UTC

How to configure solr to use Log4j for logging

Hi Everyone,

How do I configure solr to use log4j logging. I am able to configure tomcat
5.5.23 to use log4j. But I could not get solr to use log4j. I have 3 context
of solr running in tomcat which refers to war file in commons.  

-TIA
-- 
View this message in context: http://www.nabble.com/How-to-configure-solr-to-use-Log4j-for-logging-tf4065548.html#a11552026
Sent from the Solr - User mailing list archive at Nabble.com.


Re: Need question to configure Log4j for solr

Posted by Chris Hostetter <ho...@fucit.org>.
: The one issue I ran into was with daily rolling log files - maybe I
: missed it, but I didn't find that functionality in the JDK logging
: package, however it is in log4j.
:
: I'm not advocating a change, just noting this. We worked around it by
: leveraging Resin's support for wrapping a logger (set up for daily
: rolling log files) around a webapp.

as i recall Resin doens't wrap JDK logging -- they provide subclasses of
java.util.logging.Handler that do what they want (log rotation, writitng
to syslog, etc...) and provide their own LogManager subclass so they
logging can be configured in their resin.conf.

(basically they do all the things the java logging spec was designed to
let people do to have control over logging without needing any third party
logging frameworks ... it's just too bad JDK logging doesn't include all
the nice Handlers and Formatters and configuration helper utilities that
would make the API seem more usefull to people comaring it with log4j and
the other abstraction frameworks)



-Hoss


Re: Need question to configure Log4j for solr

Posted by Siegfried Goeschl <si...@it20one.at>.
Hi Ken,

and we stopped using Resin's support for daily rolling log files since 
it blocks the server for 20 minutes when rotating a 20 GB logfile - 
please don't ask what we are doing with the daily 20 GB ... :-(

Cheers,

Siegfried Goeschl

Ken Krugler wrote:
>> : the troubles comes when you integrate third-party stuff depending on
>> : log4j (as I currently do). Having said this you have a strong point 
>> when
>> : looking at http://www.qos.ch/logging/classloader.jsp
>>
>> there have been several discussions baout changing the logger used by 
>> Solr
>> ... the best summation i can give to these discussions is:
>>
>>   * JDK logging is universal
>>   * using any other logging framework would add a dependency without
>>     adding functionality
> 
> The one issue I ran into was with daily rolling log files - maybe I 
> missed it, but I didn't find that functionality in the JDK logging 
> package, however it is in log4j.
> 
> I'm not advocating a change, just noting this. We worked around it by 
> leveraging Resin's support for wrapping a logger (set up for daily 
> rolling log files) around a webapp.
> 
> -- Ken

Re: Need question to configure Log4j for solr

Posted by Ken Krugler <kk...@transpac.com>.
>: the troubles comes when you integrate third-party stuff depending on
>: log4j (as I currently do). Having said this you have a strong point when
>: looking at http://www.qos.ch/logging/classloader.jsp
>
>there have been several discussions baout changing the logger used by Solr
>... the best summation i can give to these discussions is:
>
>   * JDK logging is universal
>   * using any other logging framework would add a dependency without
>     adding functionality

The one issue I ran into was with daily rolling log files - maybe I 
missed it, but I didn't find that functionality in the JDK logging 
package, however it is in log4j.

I'm not advocating a change, just noting this. We worked around it by 
leveraging Resin's support for wrapping a logger (set up for daily 
rolling log files) around a webapp.

-- Ken
-- 
Ken Krugler
Krugle, Inc.
+1 530-210-6378
"If you can't find it, you can't fix it"

Re: Need question to configure Log4j for solr

Posted by Chris Hostetter <ho...@fucit.org>.
: the troubles comes when you integrate third-party stuff depending on
: log4j (as I currently do). Having said this you have a strong point when
: looking at http://www.qos.ch/logging/classloader.jsp

there have been several discussions baout changing the logger used by Solr
... the best summation i can give to these discussions is:

  * JDK logging is universal
  * using any other logging framework would add a dependency without
    adding functionality
  * there are too many differnet frameworks, each with their own pros/cons
    supporters/objectors that switching to any of them would be an uphill
    social battle as well as an code effort expenditure.
  * as a webapp, Solr runs ina Servlet Container - any third party
    logging framework we may pick to use could have bad interaction with
    some Servlet Containers (ie: classloader issues, etc...) but all
    servlet containers must be able to handle JDK logging.

Some reading that should be considered mandatory before any futher
discussion...

http://www.nabble.com/logging---slf4j--tf3366438.html#a9366144
http://www.nabble.com/Changing-Logging-in-Solr-to-Apache-Commons-Logging-tf3484843.html#a9782039

Specificly with regard to commons-logging, note the last paragraph of this
URL...

http://wiki.apache.org/jakarta-commons/Commons_Logging_FUD

"...In fact, there are very limited circumstances in which Commons Logging
is useful. If you're building a stand-alone application, don't use
commons-logging. ..."


-Hoss


Re: Need question to configure Log4j for solr

Posted by Siegfried Goeschl <si...@it20one.at>.
Hi Erik,

the troubles comes when you integrate third-party stuff depending on 
log4j (as I currently do). Having said this you have a strong point when 
looking at http://www.qos.ch/logging/classloader.jsp

Cheers,

Siegfried Goeschl

Erik Hatcher wrote:
> 
> On Jul 12, 2007, at 9:03 AM, Siegfried Goeschl wrote:
>> would be using commons-logging an improvement? It is a common 
>> requirement to hook up different logging infrastructure ..
> 
> My personal take on it is *adding* a dependency to keep functionality 
> the same isn't an improvement.  JDK logging, while not with as many 
> bells and whistles as Commons Logging, log4j, etc, is plenty good enough 
> and keeps us away from many of logging JARmageddon headaches.
> 
> I'm not against a logging change should others have different opinions 
> with a strong case of improvement.
> 
>     Erik
> 
> 
> 

Re: Need question to configure Log4j for solr

Posted by Erik Hatcher <er...@ehatchersolutions.com>.
On Jul 12, 2007, at 9:03 AM, Siegfried Goeschl wrote:
> would be using commons-logging an improvement? It is a common  
> requirement to hook up different logging infrastructure ..

My personal take on it is *adding* a dependency to keep functionality  
the same isn't an improvement.  JDK logging, while not with as many  
bells and whistles as Commons Logging, log4j, etc, is plenty good  
enough and keeps us away from many of logging JARmageddon headaches.

I'm not against a logging change should others have different  
opinions with a strong case of improvement.

	Erik


Re: Need question to configure Log4j for solr

Posted by Ryan McKinley <ry...@gmail.com>.
Check two related discussions:
http://www.nabble.com/logging---slf4j--tf3366438.html#a9366144
where I suggested using slf4j

and:
http://www.nabble.com/Changing-Logging-in-Solr-to-Apache-Commons-Logging-tf3484843.html#a9744439

I'm still for switching to slf4j, but am pushing it as JDK logging is fine.


Siegfried Goeschl wrote:
> Hi folks,
> 
> would be using commons-logging an improvement? It is a common 
> requirement to hook up different logging infrastructure ..
> 
> Cheers,
> 
> Siegfried Goeschl
> 
> Erik Hatcher wrote:
>>
>> On Jul 11, 2007, at 9:07 PM, solruser wrote:
>>> How do I configure solr to use log4j logging. I am able to configure 
>>> tomcat
>>> 5.5.23 to use log4j. But I could not get solr to use log4j. I have 3 
>>> context
>>> of solr running in tomcat which refers to war file in commons.
>>
>> Solr uses standard JDK logging.  I'm sure it could be bridged to log4j 
>> somehow, but rather I'd recommend you just configure JDK logging how 
>> you'd like.
>>
>>     Erik
>>
>>
>>
> 


Re: Need question to configure Log4j for solr

Posted by Siegfried Goeschl <si...@it20one.at>.
Hi folks,

would be using commons-logging an improvement? It is a common 
requirement to hook up different logging infrastructure ..

Cheers,

Siegfried Goeschl

Erik Hatcher wrote:
> 
> On Jul 11, 2007, at 9:07 PM, solruser wrote:
>> How do I configure solr to use log4j logging. I am able to configure 
>> tomcat
>> 5.5.23 to use log4j. But I could not get solr to use log4j. I have 3 
>> context
>> of solr running in tomcat which refers to war file in commons.
> 
> Solr uses standard JDK logging.  I'm sure it could be bridged to log4j 
> somehow, but rather I'd recommend you just configure JDK logging how 
> you'd like.
> 
>     Erik
> 
> 
> 

Re: Need question to configure Log4j for solr

Posted by Erik Hatcher <er...@ehatchersolutions.com>.
On Jul 11, 2007, at 9:07 PM, solruser wrote:
> How do I configure solr to use log4j logging. I am able to  
> configure tomcat
> 5.5.23 to use log4j. But I could not get solr to use log4j. I have  
> 3 context
> of solr running in tomcat which refers to war file in commons.

Solr uses standard JDK logging.  I'm sure it could be bridged to  
log4j somehow, but rather I'd recommend you just configure JDK  
logging how you'd like.

	Erik