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 Rémy Loubradou <re...@hipsnip.com> on 2012/07/19 18:28:54 UTC

Re: Problem with Solr logging under Jetty

Hello,

I have a similar problem, anything new about this issue?

My problem is that info logs go to stderr and not stdout, do you have an
explanation?

For the log level I use the file "logging.properties" with in it only one
line setting the level.

============================================
.level = INFO
============================================

and I have a configuration file called "jetty-logging.xml" passed at
startup of jetty through start.ini for redirect stdout to a file and stderr
to another file, the config looks like this:

============================================
<?xml version="1.0"?>
<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "
http://www.eclipse.org/jetty/configure.dtd">


<Configure id="Server" class="org.eclipse.jetty.server.Server">
    <!-- ###############################################################
-->
    <!-- # Logging configuration                                       #
-->
    <!-- ###############################################################
-->
    <!-- # stderr Log                                                  #
-->
    <New id="stderrLog" class="java.io.PrintStream">
        <Arg>
            <New class="org.eclipse.jetty.util.RolloverFileOutputStream">
                <Arg><Property name="jetty.logs" default="<%=
node.jetty.log_dir %>"/>/jetty_err.log</Arg>
                <Arg type="boolean">true</Arg>
                <Arg type="int">90</Arg>
                <Arg><Call class="java.util.TimeZone"
name="getTimeZone"><Arg>GMT</Arg></Call></Arg>
                <Get id="stderrLogName" name="datedFilename"/>
            </New>
        </Arg>
    </New>

    <!-- ###############################################################
-->
    <!-- # stdout Log                                                  #
-->
    <New id="stdoutLog" class="java.io.PrintStream">
        <Arg>
            <New class="org.eclipse.jetty.util.RolloverFileOutputStream">
                <Arg><Property name="jetty.logs" default="<%=
node.jetty.log_dir %>"/>/jetty_out.log</Arg>
                <Arg type="boolean">true</Arg>
                <Arg type="int">90</Arg>
                <Arg><Call class="java.util.TimeZone"
name="getTimeZone"><Arg>GMT</Arg></Call></Arg>
                <Get id="stdoutLogName" name="datedFilename"/>
            </New>
        </Arg>
    </New>

    <Call class="org.eclipse.jetty.util.log.Log" name="info">
        <Arg>Redirecting stdout to <Ref id="stdoutLogName"/></Arg>
    </Call>

    <Call class="org.eclipse.jetty.util.log.Log" name="info">
        <Arg>Redirecting stderr to <Ref id="stderrLogName"/></Arg>
    </Call>

    <Call class="java.lang.System" name="setErr">
        <Arg><Ref id="stderrLog"/></Arg>
    </Call>

    <Call class="java.lang.System" name="setOut">
        <Arg><Ref id="stdoutLog"/></Arg>
    </Call>
</Configure>
============================================

Thanks for your help,
Remy

On 23 November 2011 16:55, Shawn Heisey <so...@elyograg.org> wrote:

> I am having a problem with jdk logging with Solr, using the jetty included
> with Solr.
>
> In jetty.xml, I have the following defined:
> <Call class="java.lang.System" name="setProperty">
> <Arg>java.util.logging.config.**file</Arg>
> <Arg>etc/logging.properties</**Arg>
> </Call>

Contents of etc/logging.properties:
> ======
> #  Logging level
> .level=WARNING
>
> # Write to a file
> handlers = java.util.logging.FileHandler
>
> # Write log messages in human readable format:
> java.util.logging.FileHandler.**formatter = java.util.logging.**
> SimpleFormatter
> java.util.logging.**ConsoleHander.formatter = java.util.logging.**
> SimpleFormatter
>
> # Log to the log subdirectory, with log files named solr_log-n.log
> java.util.logging.FileHandler.**pattern = ./log/solr_log-%g.log
> java.util.logging.FileHandler.**append = true
> java.util.logging.FileHandler.**count = 10
> java.util.logging.FileHandler.**limit = 10485760
> ======
>
> This actually all seems to work perfectly at first.  I changed the logging
> level to INFO in the solr admin, and it still seemed to work.  Then at some
> point it stopped logging to solr_log-0.log and started logging to stderr.
>  My init script for Solr sends that to a file, but there's no log rotation
> on that file and it is overwritten whenever Solr is restarted.
>
> With the same config, OS version, java version, and everything else I can
> think of, my test server is still working, but all of my production servers
> aren't.  It does seem to be related to changing the log level to INFO in
> the gui, but making that change doesn't make it fail right away.
>
> What information can I provide to help troubleshoot this?
>
> Thanks,
> Shawn
>
>