Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

Commit

Permalink
[internal] loading the logging configuration must not assumed explode…
Browse files Browse the repository at this point in the history
…d war deployment
  • Loading branch information
smee committed Aug 27, 2010
1 parent 2f1271c commit 59b2b06
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 15 deletions.
Expand Up @@ -22,10 +22,8 @@
package de.thorstenberger.examServer.service.impl;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.net.URISyntaxException;
import java.io.InputStream;
import java.util.Properties;

import javax.servlet.ServletContext;
Expand Down Expand Up @@ -59,13 +57,11 @@ public ExamServerManagerImpl() {
// TODO Auto-generated constructor stub
}

private void configLogging(final File log4JConfigFile) {
private void configLogging(final InputStream inputStream) {

final Properties p = new Properties();
try {
p.load(new FileInputStream(log4JConfigFile));
} catch (final FileNotFoundException e) {
throw new RuntimeException(e);
p.load(inputStream);
} catch (final IOException e) {
throw new RuntimeException(e);
}
Expand Down Expand Up @@ -161,13 +157,7 @@ public void init() {
}

if (sc != null) {
File log4j;
try {
log4j = new File(this.getClass().getClassLoader().getResource("examserverLog4j.properties").toURI());
configLogging(log4j);
} catch (final URISyntaxException e) {
throw new RuntimeException(e);
}
configLogging(this.getClass().getClassLoader().getResourceAsStream("examserverLog4j.properties"));
}

}
Expand Down
2 changes: 1 addition & 1 deletion examServer/src/main/webapp/WEB-INF/web.xml
Expand Up @@ -2,7 +2,7 @@
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app>
<display-name>appfuse</display-name>
<display-name>examServer</display-name>
<!-- precompiled jsp mappings
Define the default CSS Theme -->
<context-param>
Expand Down

0 comments on commit 59b2b06

Please sign in to comment.