Skip to content
Snippets Groups Projects
Commit 5dea1554 authored by ribeaudc's avatar ribeaudc
Browse files

minor:

- improve javadoc.
- method/variable made final when possible.

SVN: 2479
parent 60539b42
No related branches found
No related tags found
No related merge requests found
...@@ -30,21 +30,24 @@ import org.apache.log4j.xml.DOMConfigurator; ...@@ -30,21 +30,24 @@ import org.apache.log4j.xml.DOMConfigurator;
*/ */
public class LogInitializer public class LogInitializer
{ {
static { static
{
// Do not let log4j configure itself. We will do it our own way. // Do not let log4j configure itself. We will do it our own way.
// Look at page 84 of the manual to get to know the default initialization. // Look at page 84 of the manual to get to know the default initialization.
System.setProperty("log4j.defaultInitOverride", "true"); System.setProperty("log4j.defaultInitOverride", "true");
} }
private static boolean initialized = false; private static boolean initialized = false;
/** /**
* Initializes logging system. Does nothing if already initialized. * Initializes logging system. Does nothing if already initialized.
* Logging configuration file is assumed to be in <code>&lt;working directory&gt;/ect/log.xml</code>. * <p>
* If not found we look for a classpath resource named <code>/etc/log.xml</code>. If nothing found in both * Logging configuration file is assumed to be in <code>&lt;working directory&gt;/etc/log.xml</code>. If not
* locations <code>org.apache.log4j.BaseConfigurator.configure()</code> * found we look for a classpath resource named <code>/etc/log.xml</code>.<br>
* If nothing found in both locations <code>org.apache.log4j.BaseConfigurator.configure()</code> is used.
* </p>
*/ */
public static synchronized void init() public final static synchronized void init()
{ {
if (initialized) if (initialized)
{ {
...@@ -60,7 +63,7 @@ public class LogInitializer ...@@ -60,7 +63,7 @@ public class LogInitializer
DOMConfigurator.configureAndWatch(logFile.getPath()); DOMConfigurator.configureAndWatch(logFile.getPath());
} else } else
{ {
URL url = LogInitializer.class.getResource("/" + logDirectory + "/" + logFilename); final URL url = LogInitializer.class.getResource("/" + logDirectory + "/" + logFilename);
if (url != null) if (url != null)
{ {
DOMConfigurator.configure(url); DOMConfigurator.configure(url);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment