You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-dev@lucene.apache.org by Igor Motov <im...@gmail.com> on 2010/03/25 16:22:53 UTC

ZooKeeper Logging

I wonder if it would make sense to replace log4j-1.2.15.jar in the lib
directory of the cloud branch with log4j-over-slf4j-1.5.5.jar. SOLR is
already using SLF4J for its logging and log4j-over-slf4j bridge would
redirect all ZooKeeper log messages into the same SLF4J logging stream. I
did it in my setup and and it helped me a lot when I ran into issues with my
ZooKeeper configuration.

Thank you,

Igor

RE: ZooKeeper Logging

Posted by "Zhou, Yaning" <ya...@zoominfo.com>.
Yes,

That's exactly what we did here:)

Yaning

-----Original Message-----
From: Igor Motov [mailto:imotov@gmail.com] 
Sent: Thursday, March 25, 2010 8:13 PM
To: solr-dev@lucene.apache.org
Subject: Re: ZooKeeper Logging

I agree, this is concerning. There is a similar situation with JCL in SOLR
1.4 (http://www.mail-archive.com/solr-dev@lucene.apache.org/msg13600.html).
With log4j-over-slf4j-X.Y.Z.jar in the .war file, whoever will need to
switch the logging system will have to make sure that an appropriate set of
*-over-slf4j and slf4j-* files is in the classpath.

So, it might make sense to change the last paragraph of
http://wiki.apache.org/solr/SolrLogging to something like this:

----
Users who want an alternate logging implementation (log4j, logback, jcl,
etc) will need to repackage the .war file and replace slf4j-jdk14-X.Y.Z.jar
with an alternate implementation. They should also remove
jcl-over-slf4j-X.Y.Z.jar if they are switching to JCL and
log4j-over-slf4j-X.Y.Z.jar if they are using cloud branch and switching to
log4j. Having both jcl-over-slf4j and slf4j-jcl.jar or log4j-over-slf4j.jar
and slf4j-log4j.jar in the classpath may result in an infinite loop.
----

There is already a link to slf4j site on the page. But, it might be also
useful to add a link directly to the page that describes SLF4J bridges:
http://www.slf4j.org/legacy.html

Igor

On Thu, Mar 25, 2010 at 4:26 PM, Mark Miller <ma...@gmail.com> wrote:

> On 03/25/2010 11:27 AM, Mark Miller wrote:
>
>> On 03/25/2010 11:22 AM, Igor Motov wrote:
>>
>>> I wonder if it would make sense to replace log4j-1.2.15.jar in the lib
>>> directory of the cloud branch with log4j-over-slf4j-1.5.5.jar. SOLR is
>>> already using SLF4J for its logging and log4j-over-slf4j bridge would
>>> redirect all ZooKeeper log messages into the same SLF4J logging stream. I
>>> did it in my setup and and it helped me a lot when I ran into issues with
>>> my
>>> ZooKeeper configuration.
>>>
>>> Thank you,
>>>
>>> Igor
>>>
>>>  Yeah, this is a great idea - been meaning to look into this since Uwe
>> mentioned to me that it was possible the other week. Hadn't realized these
>> bridge jars existed previously. Yonik had started looking into getting the
>> ZooKeeper project to switch to SLF4J, but this is a great solution for now.
>>
>>
> Hmm - I've done this for now - but this is going to need some good
> documentation at the least. It works great for Solr in it's default state
> (using util logging) - but you don't want this jar if you choose to use the
> log4j connector. Otherwise they loop back and forth with each other.
>
> --
> - Mark
>
> http://www.lucidimagination.com
>
>
>
>

Re: ZooKeeper Logging

Posted by Igor Motov <im...@gmail.com>.
I agree, this is concerning. There is a similar situation with JCL in SOLR
1.4 (http://www.mail-archive.com/solr-dev@lucene.apache.org/msg13600.html).
With log4j-over-slf4j-X.Y.Z.jar in the .war file, whoever will need to
switch the logging system will have to make sure that an appropriate set of
*-over-slf4j and slf4j-* files is in the classpath.

So, it might make sense to change the last paragraph of
http://wiki.apache.org/solr/SolrLogging to something like this:

----
Users who want an alternate logging implementation (log4j, logback, jcl,
etc) will need to repackage the .war file and replace slf4j-jdk14-X.Y.Z.jar
with an alternate implementation. They should also remove
jcl-over-slf4j-X.Y.Z.jar if they are switching to JCL and
log4j-over-slf4j-X.Y.Z.jar if they are using cloud branch and switching to
log4j. Having both jcl-over-slf4j and slf4j-jcl.jar or log4j-over-slf4j.jar
and slf4j-log4j.jar in the classpath may result in an infinite loop.
----

There is already a link to slf4j site on the page. But, it might be also
useful to add a link directly to the page that describes SLF4J bridges:
http://www.slf4j.org/legacy.html

Igor

On Thu, Mar 25, 2010 at 4:26 PM, Mark Miller <ma...@gmail.com> wrote:

> On 03/25/2010 11:27 AM, Mark Miller wrote:
>
>> On 03/25/2010 11:22 AM, Igor Motov wrote:
>>
>>> I wonder if it would make sense to replace log4j-1.2.15.jar in the lib
>>> directory of the cloud branch with log4j-over-slf4j-1.5.5.jar. SOLR is
>>> already using SLF4J for its logging and log4j-over-slf4j bridge would
>>> redirect all ZooKeeper log messages into the same SLF4J logging stream. I
>>> did it in my setup and and it helped me a lot when I ran into issues with
>>> my
>>> ZooKeeper configuration.
>>>
>>> Thank you,
>>>
>>> Igor
>>>
>>>  Yeah, this is a great idea - been meaning to look into this since Uwe
>> mentioned to me that it was possible the other week. Hadn't realized these
>> bridge jars existed previously. Yonik had started looking into getting the
>> ZooKeeper project to switch to SLF4J, but this is a great solution for now.
>>
>>
> Hmm - I've done this for now - but this is going to need some good
> documentation at the least. It works great for Solr in it's default state
> (using util logging) - but you don't want this jar if you choose to use the
> log4j connector. Otherwise they loop back and forth with each other.
>
> --
> - Mark
>
> http://www.lucidimagination.com
>
>
>
>

Re: ZooKeeper Logging

Posted by Mark Miller <ma...@gmail.com>.
On 03/25/2010 11:27 AM, Mark Miller wrote:
> On 03/25/2010 11:22 AM, Igor Motov wrote:
>> I wonder if it would make sense to replace log4j-1.2.15.jar in the lib
>> directory of the cloud branch with log4j-over-slf4j-1.5.5.jar. SOLR is
>> already using SLF4J for its logging and log4j-over-slf4j bridge would
>> redirect all ZooKeeper log messages into the same SLF4J logging 
>> stream. I
>> did it in my setup and and it helped me a lot when I ran into issues 
>> with my
>> ZooKeeper configuration.
>>
>> Thank you,
>>
>> Igor
>>
> Yeah, this is a great idea - been meaning to look into this since Uwe 
> mentioned to me that it was possible the other week. Hadn't realized 
> these bridge jars existed previously. Yonik had started looking into 
> getting the ZooKeeper project to switch to SLF4J, but this is a great 
> solution for now.
>

Hmm - I've done this for now - but this is going to need some good 
documentation at the least. It works great for Solr in it's default 
state (using util logging) - but you don't want this jar if you choose 
to use the log4j connector. Otherwise they loop back and forth with each 
other.

-- 
- Mark

http://www.lucidimagination.com




Re: ZooKeeper Logging

Posted by Mark Miller <ma...@gmail.com>.
On 03/25/2010 11:22 AM, Igor Motov wrote:
> I wonder if it would make sense to replace log4j-1.2.15.jar in the lib
> directory of the cloud branch with log4j-over-slf4j-1.5.5.jar. SOLR is
> already using SLF4J for its logging and log4j-over-slf4j bridge would
> redirect all ZooKeeper log messages into the same SLF4J logging stream. I
> did it in my setup and and it helped me a lot when I ran into issues with my
> ZooKeeper configuration.
>
> Thank you,
>
> Igor
>
>    
Yeah, this is a great idea - been meaning to look into this since Uwe 
mentioned to me that it was possible the other week. Hadn't realized 
these bridge jars existed previously. Yonik had started looking into 
getting the ZooKeeper project to switch to SLF4J, but this is a great 
solution for now.

-- 
- Mark

http://www.lucidimagination.com