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 richardg <ri...@dvdempire.com> on 2013/05/09 18:24:45 UTC

4.3 logging setup

On all prior index version I setup my log via the logging.properties file in
/usr/local/tomcat/conf, it looked like this:

# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements.  See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License.  You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

handlers = 1catalina.org.apache.juli.FileHandler,
2localhost.org.apache.juli.FileHandler,
3manager.org.apache.juli.FileHandler,
4host-manager.org.apache.juli.FileHandler, java.util.logging.ConsoleHandler

.handlers = 1catalina.org.apache.juli.FileHandler,
java.util.logging.ConsoleHandler

############################################################
# Handler specific properties.
# Describes specific configuration info for Handlers.
############################################################

1catalina.org.apache.juli.FileHandler.level = WARNING
1catalina.org.apache.juli.FileHandler.directory = ${catalina.base}/logs
1catalina.org.apache.juli.FileHandler.prefix = catalina.

2localhost.org.apache.juli.FileHandler.level = FINE
2localhost.org.apache.juli.FileHandler.directory = ${catalina.base}/logs
2localhost.org.apache.juli.FileHandler.prefix = localhost.

3manager.org.apache.juli.FileHandler.level = FINE
3manager.org.apache.juli.FileHandler.directory = ${catalina.base}/logs
3manager.org.apache.juli.FileHandler.prefix = manager.

4host-manager.org.apache.juli.FileHandler.level = FINE
4host-manager.org.apache.juli.FileHandler.directory = ${catalina.base}/logs
4host-manager.org.apache.juli.FileHandler.prefix = host-manager.

java.util.logging.ConsoleHandler.level = FINE
java.util.logging.ConsoleHandler.formatter =
java.util.logging.SimpleFormatter


############################################################
# Facility specific properties.
# Provides extra control for each logger.
############################################################

org.apache.catalina.core.ContainerBase.[Catalina].[localhost].level = INFO
org.apache.catalina.core.ContainerBase.[Catalina].[localhost].handlers =
2localhost.org.apache.juli.FileHandler

org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/manager].level
= INFO
org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/manager].handlers
= 3manager.org.apache.juli.FileHandler

org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/host-manager].level
= INFO
org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/host-manager].handlers
= 4host-manager.org.apache.juli.FileHandler

# For example, set the org.apache.catalina.util.LifecycleBase logger to log
# each component that extends LifecycleBase changing state:
#org.apache.catalina.util.LifecycleBase.level = FINE

# To see debug messages in TldLocationsCache, uncomment the following line:
#org.apache.jasper.compiler.TldLocationsCache.level = FINE

After upgrading to 4.3 today the files defined aren't being logged to.  I
know things have changed for logging w/ 4.3 but how can I get it setup like
it was before?



--
View this message in context: http://lucene.472066.n3.nabble.com/4-3-logging-setup-tp4061875.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: 4.3 logging setup

Posted by Jan Høydahl <ja...@cominvent.com>.
Hi,

FIrst of all, to setup loggin using Log4J (which is really better than JULI), copy all the jars from Jetty's lib/ext over to tomcat's lib folder, see instructions here: http://wiki.apache.org/solr/SolrLogging#Solr_4.3_and_above. You can place your log4j.properties in tomcat/lib as well so it will be read automatically.

Now when you start your Tomcat, you will find a file tomcat/logs/solr.log in nicer format than before, with one log entry per line instead of two, and automatic log file rotation and cleaning.

However, if you like to switch to Java Util logging, do the following:

1. Download slf4j version 1.6.6 (since that's what we use). http://www.slf4j.org/dist/slf4j-1.6.6.zip
2. Unpack, and pull out the file slf4j-jdk14-1.6.6.jar
3. Remove tomcat/lib/slf4j-log4j12-1.6.6.jar and copy slf4j-jdk14-1.6.6.jar to tomcat/lib instead
4. Use your old logging.properties (either place it on classpath or point to it with startup opt)

--
Jan Høydahl, search solution architect
Cominvent AS - www.cominvent.com

9. mai 2013 kl. 20:41 skrev richardg <ri...@dvdempire.com>:

> Thanks for responding.  My issue is I've never changed anything w/ logging, I
> have always used the built in Juli.  I've never messed w/ any jar files,
> just had edit the logging.properties file.  I don't know where I would get
> the jars for juli or where to put them, if that is what is needed.  I had
> read what you posted before I just can't make any sense of it.
> 
> Thanks
> 
> 
> 
> --
> View this message in context: http://lucene.472066.n3.nabble.com/4-3-logging-setup-tp4061875p4061901.html
> Sent from the Solr - User mailing list archive at Nabble.com.


Re: 4.3 logging setup

Posted by Jan Høydahl <ja...@cominvent.com>.
I've updated the WIKI: http://wiki.apache.org/solr/SolrLogging#Switching_from_Log4J_logging_back_to_Java-util_logging

--
Jan Høydahl, search solution architect
Cominvent AS - www.cominvent.com

9. mai 2013 kl. 21:57 skrev Shawn Heisey <so...@elyograg.org>:

> On 5/9/2013 1:41 PM, richardg wrote:
>> These are the files I have in my /lib folder:
>> 
>> slf4j-api-1.6.6
>> log4j-1.2.16
>> jul-to-slf4j-1.6.6
>> jcl-over-slf4j-1.6.6
>> slf4j-jdk14-1.6.6
>> log4j-over-slf4j-1.6.6
>> 
>> Currently everything seems to be logging like before.  After I followed the
>> instructions in Jan's post replacing slf4j-log4j12-1.6.6.jar with this
>> slf4j-jdk14-1.6.6.jar it all started working.  Shawn I then removed
>> everything as you instructed and put in just  log4j-over-slf4j-1.6.6.jar and
>> slf4j-jdk14-1.6.6.jar but the index showed an error and wouldn't start.  So
>> that is why I have those 6 files in there now, I'm not sure if
>> log4j-over-slf4j-1.6.6.jar this file is needed or not.  Let me know if you
>> need me to test anything else.
> 
> You're on the right track.  Your list just has two files that shouldn't be there - log4j-1.2.16 and jul-to-slf4j-1.6.6.  They are probably not causing any real problems, but they might in the future.
> 
> Remove those and you will have the exact list I was looking for.  If that doesn't work, use a paste website (pastie.org and others) to send a log showing the errors you get.
> 
> Thanks,
> Shawn
> 


Re: 4.3 logging setup

Posted by Shawn Heisey <so...@elyograg.org>.
On 5/9/2013 1:41 PM, richardg wrote:
> These are the files I have in my /lib folder:
>
> slf4j-api-1.6.6
> log4j-1.2.16
> jul-to-slf4j-1.6.6
> jcl-over-slf4j-1.6.6
> slf4j-jdk14-1.6.6
> log4j-over-slf4j-1.6.6
>
> Currently everything seems to be logging like before.  After I followed the
> instructions in Jan's post replacing slf4j-log4j12-1.6.6.jar with this
> slf4j-jdk14-1.6.6.jar it all started working.  Shawn I then removed
> everything as you instructed and put in just  log4j-over-slf4j-1.6.6.jar and
> slf4j-jdk14-1.6.6.jar but the index showed an error and wouldn't start.  So
> that is why I have those 6 files in there now, I'm not sure if
> log4j-over-slf4j-1.6.6.jar this file is needed or not.  Let me know if you
> need me to test anything else.

You're on the right track.  Your list just has two files that shouldn't 
be there - log4j-1.2.16 and jul-to-slf4j-1.6.6.  They are probably not 
causing any real problems, but they might in the future.

Remove those and you will have the exact list I was looking for.  If 
that doesn't work, use a paste website (pastie.org and others) to send a 
log showing the errors you get.

Thanks,
Shawn


Re: 4.3 logging setup

Posted by richardg <ri...@dvdempire.com>.
These are the files I have in my /lib folder:

slf4j-api-1.6.6
log4j-1.2.16
jul-to-slf4j-1.6.6
jcl-over-slf4j-1.6.6
slf4j-jdk14-1.6.6
log4j-over-slf4j-1.6.6

Currently everything seems to be logging like before.  After I followed the
instructions in Jan's post replacing slf4j-log4j12-1.6.6.jar with this
slf4j-jdk14-1.6.6.jar it all started working.  Shawn I then removed
everything as you instructed and put in just  log4j-over-slf4j-1.6.6.jar and
slf4j-jdk14-1.6.6.jar but the index showed an error and wouldn't start.  So
that is why I have those 6 files in there now, I'm not sure if
log4j-over-slf4j-1.6.6.jar this file is needed or not.  Let me know if you
need me to test anything else.

Thanks



--
View this message in context: http://lucene.472066.n3.nabble.com/4-3-logging-setup-tp4061875p4061922.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: 4.3 logging setup

Posted by Shawn Heisey <so...@elyograg.org>.
On 5/9/2013 12:54 PM, Jason Hellman wrote:
> If you nab the jars in example/lib/ext and place them within the appropriate folder in Tomcat (and this will somewhat depend on which version of Tomcat you are using…let's presume tomcat/lib as a brute-force approach) you should be back in business.
>
> On May 9, 2013, at 11:41 AM, richardg <ri...@dvdempire.com> wrote:
>
>> Thanks for responding.  My issue is I've never changed anything w/ logging, I
>> have always used the built in Juli.  I've never messed w/ any jar files,
>> just had edit the logging.properties file.  I don't know where I would get
>> the jars for juli or where to put them, if that is what is needed.  I had
>> read what you posted before I just can't make any sense of it.

I've been looking into this a little bit. Tomcat's juli is an apache 
reimplementation of java.util.logging.  Solr uses SLF4J, but before 4.3, 
Solr's slf4j was bound to java.util.logging ... which I would bet was 
being intercepted by tomcat and sent through the juli config.

With 4.3, SLF4J is bound to log4j by default.  If you stick with this 
binding, then you need to configure log4j instead of juli.

Richard, you could go back to java.util.logging (the way earlier 
versions had it) with this procedure, and this will probably restore the 
ability to configure logging with juli.

- Delete the following jars from Solr's example lib/ext:
-- jul-to-slf4j-1.6.6.jar
-- log4j-1.2.16.jar
-- slf4j-log4j12-1.6.6.jar
- Download slf4j version 1.6.6 from their website.
- Copy the following jars from the download into lib/ext:
-- log4j-over-slf4j-1.6.6.jar
-- slf4j-jdk14-1.6.6.jar
- Copy all jars in lib/ext to tomcat's lib directory.

http://www.slf4j.org/dist/
http://www.slf4j.org

Alternatively, you could copy the jars from lib/ext to a directory in 
your classpath, or add Solr's lib/ext to your classpath.

If you want to upgrade to the newest slf4j, you can, you'll just have to 
use the new version for all slf4j jars.

Please let me know whether this worked for you so we can get a proper 
procedure up on the wiki.

Thanks,
Shawn


Re: 4.3 logging setup

Posted by richardg <ri...@dvdempire.com>.
I had already copied those jars over and gotten the app to start(it wouldn't
without them).  I was able configure solf4j/log4j logging using the
log4j.properties in the /lib folder to start logging but I don't want to
switch.  I have alerts set on the wording that the juli logging puts out but
everything I've tried to get it to work has failed.  I have older
indexes(4.2 and under) running on the server that are still able to log
correctly, it is just 4.3.  I am obviously missing something.

Thanks



--
View this message in context: http://lucene.472066.n3.nabble.com/4-3-logging-setup-tp4061875p4061907.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: 4.3 logging setup

Posted by Jason Hellman <jh...@innoventsolutions.com>.
If you nab the jars in example/lib/ext and place them within the appropriate folder in Tomcat (and this will somewhat depend on which version of Tomcat you are using…let's presume tomcat/lib as a brute-force approach) you should be back in business.

On May 9, 2013, at 11:41 AM, richardg <ri...@dvdempire.com> wrote:

> Thanks for responding.  My issue is I've never changed anything w/ logging, I
> have always used the built in Juli.  I've never messed w/ any jar files,
> just had edit the logging.properties file.  I don't know where I would get
> the jars for juli or where to put them, if that is what is needed.  I had
> read what you posted before I just can't make any sense of it.
> 
> Thanks
> 
> 
> 
> --
> View this message in context: http://lucene.472066.n3.nabble.com/4-3-logging-setup-tp4061875p4061901.html
> Sent from the Solr - User mailing list archive at Nabble.com.


Re: 4.3 logging setup

Posted by richardg <ri...@dvdempire.com>.
Thanks for responding.  My issue is I've never changed anything w/ logging, I
have always used the built in Juli.  I've never messed w/ any jar files,
just had edit the logging.properties file.  I don't know where I would get
the jars for juli or where to put them, if that is what is needed.  I had
read what you posted before I just can't make any sense of it.

Thanks



--
View this message in context: http://lucene.472066.n3.nabble.com/4-3-logging-setup-tp4061875p4061901.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: 4.3 logging setup

Posted by Jason Hellman <jh...@innoventsolutions.com>.
From:

http://lucene.apache.org/solr/4_3_0/changes/Changes.html#4.3.0.upgrading_from_solr_4.2.0

Slf4j/logging jars are no longer included in the Solr webapp. All logging jars are now in example/lib/ext. Changing logging impls is now as easy as updating the jars in this folder with those necessary for the logging impl you would like. If you are using another webapp container, these jars will need to go in the corresponding location for that container. In conjunction, the dist-excl-slf4j and dist-war-excl-slf4 build targets have been removed since they are redundent. See the Slf4j documentation, SOLR-3706, and SOLR-4651 for more details.

It should just require you provide your preferred logging jars within an appropriate classpath. 


On May 9, 2013, at 9:24 AM, richardg <ri...@dvdempire.com> wrote:

> On all prior index version I setup my log via the logging.properties file in
> /usr/local/tomcat/conf, it looked like this:
> 
> # Licensed to the Apache Software Foundation (ASF) under one or more
> # contributor license agreements.  See the NOTICE file distributed with
> # this work for additional information regarding copyright ownership.
> # The ASF licenses this file to You under the Apache License, Version 2.0
> # (the "License"); you may not use this file except in compliance with
> # the License.  You may obtain a copy of the License at
> #
> #     http://www.apache.org/licenses/LICENSE-2.0
> #
> # Unless required by applicable law or agreed to in writing, software
> # distributed under the License is distributed on an "AS IS" BASIS,
> # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
> # See the License for the specific language governing permissions and
> # limitations under the License.
> 
> handlers = 1catalina.org.apache.juli.FileHandler,
> 2localhost.org.apache.juli.FileHandler,
> 3manager.org.apache.juli.FileHandler,
> 4host-manager.org.apache.juli.FileHandler, java.util.logging.ConsoleHandler
> 
> .handlers = 1catalina.org.apache.juli.FileHandler,
> java.util.logging.ConsoleHandler
> 
> ############################################################
> # Handler specific properties.
> # Describes specific configuration info for Handlers.
> ############################################################
> 
> 1catalina.org.apache.juli.FileHandler.level = WARNING
> 1catalina.org.apache.juli.FileHandler.directory = ${catalina.base}/logs
> 1catalina.org.apache.juli.FileHandler.prefix = catalina.
> 
> 2localhost.org.apache.juli.FileHandler.level = FINE
> 2localhost.org.apache.juli.FileHandler.directory = ${catalina.base}/logs
> 2localhost.org.apache.juli.FileHandler.prefix = localhost.
> 
> 3manager.org.apache.juli.FileHandler.level = FINE
> 3manager.org.apache.juli.FileHandler.directory = ${catalina.base}/logs
> 3manager.org.apache.juli.FileHandler.prefix = manager.
> 
> 4host-manager.org.apache.juli.FileHandler.level = FINE
> 4host-manager.org.apache.juli.FileHandler.directory = ${catalina.base}/logs
> 4host-manager.org.apache.juli.FileHandler.prefix = host-manager.
> 
> java.util.logging.ConsoleHandler.level = FINE
> java.util.logging.ConsoleHandler.formatter =
> java.util.logging.SimpleFormatter
> 
> 
> ############################################################
> # Facility specific properties.
> # Provides extra control for each logger.
> ############################################################
> 
> org.apache.catalina.core.ContainerBase.[Catalina].[localhost].level = INFO
> org.apache.catalina.core.ContainerBase.[Catalina].[localhost].handlers =
> 2localhost.org.apache.juli.FileHandler
> 
> org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/manager].level
> = INFO
> org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/manager].handlers
> = 3manager.org.apache.juli.FileHandler
> 
> org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/host-manager].level
> = INFO
> org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/host-manager].handlers
> = 4host-manager.org.apache.juli.FileHandler
> 
> # For example, set the org.apache.catalina.util.LifecycleBase logger to log
> # each component that extends LifecycleBase changing state:
> #org.apache.catalina.util.LifecycleBase.level = FINE
> 
> # To see debug messages in TldLocationsCache, uncomment the following line:
> #org.apache.jasper.compiler.TldLocationsCache.level = FINE
> 
> After upgrading to 4.3 today the files defined aren't being logged to.  I
> know things have changed for logging w/ 4.3 but how can I get it setup like
> it was before?
> 
> 
> 
> --
> View this message in context: http://lucene.472066.n3.nabble.com/4-3-logging-setup-tp4061875.html
> Sent from the Solr - User mailing list archive at Nabble.com.