2014-12-20 22:43 GMT+03:00  <ma...@apache.org>:
> Author: markt
> Date: Sat Dec 20 19:43:29 2014
> New Revision: 1647044
>
> URL: http://svn.apache.org/r1647044
> Log:
> Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=57363
> Log to stderr if LogManager is unable to read configuration files rather than 
> swallowing the exception silently.
>
> Modified:
>     tomcat/tc7.0.x/trunk/   (props changed)
>     tomcat/tc7.0.x/trunk/java/org/apache/juli/ClassLoaderLogManager.java
>     tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml
>
> Modified: tomcat/tc7.0.x/trunk/java/org/apache/juli/ClassLoaderLogManager.java
> URL: 
> http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/juli/ClassLoaderLogManager.java?rev=1647044&r1=1647043&r2=1647044&view=diff
> ==============================================================================
> --- tomcat/tc7.0.x/trunk/java/org/apache/juli/ClassLoaderLogManager.java 
> (original)
> +++ tomcat/tc7.0.x/trunk/java/org/apache/juli/ClassLoaderLogManager.java Sat 
> Dec 20 19:43:29 2014
> @@ -465,7 +465,8 @@ public class ClassLoaderLogManager exten
>                  try {
>                      is = new FileInputStream(replace(configFileStr));
>                  } catch (IOException e) {
> -                    // Ignore
> +                    System.err.println("Configuration error");
> +                    e.printStackTrace();
>                  }
>              }
>              // Try the default JVM configuration
> @@ -475,7 +476,8 @@ public class ClassLoaderLogManager exten
>                  try {
>                      is = new FileInputStream(defaultFile);
>                  } catch (IOException e) {
> -                    // Critical problem, do something ...
> +                    System.err.println("Configuration error");
> +                    e.printStackTrace();
>                  }
>              }
>          }

1) Maybe mention the file name in that println line. In general, it
shall be present in the IOException message, but it is not 100%
certain.

2) The recipe for using Log4J with Tomcat says:
http://tomcat.apache.org/tomcat-8.0-doc/logging.html#Using_Log4j

[[[
6. Delete $CATALINA_BASE/conf/logging.properties to prevent
java.util.logging generating zero length log files.
]]]

As such, I expect that those configurations will start logging this
error message.

I think that that step shall be replaced with creating a zero-length
logging.properties file. (I thought that our docs were already saying
so, but the actual text is different).


Best regards,
Konstantin Kolinko


> Modified: tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml
> URL: 
> http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml?rev=1647044&r1=1647043&r2=1647044&view=diff
> ==============================================================================
> --- tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml (original)
> +++ tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml Sat Dec 20 19:43:29 2014
> @@ -173,6 +173,11 @@
>        <update>
>            Add more AJP unit tests. (rjung)
>        </update>
> +      <fix>
> +        <bug>57363</bug>: Log to stderr if LogManager is unable to read
> +        configuration files rather than swallowing the exception silently.
> +        (markt)
> +      </fix>
>      </changelog>
>    </subsection>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to