Skip to content

Commit

Permalink
fix exception on startup
Browse files Browse the repository at this point in the history
  • Loading branch information
graemerocher committed May 6, 2014
1 parent ec94316 commit 6303356
Showing 1 changed file with 8 additions and 2 deletions.
Expand Up @@ -654,8 +654,14 @@ protected void initializeLogging() {
Class<?> cls = Thread.currentThread().getContextClassLoader().loadClass("org.apache.log4j.PropertyConfigurator");
Method configure = cls.getMethod("configure", URL.class);
configure.setAccessible(true);
File f = new File(settings.getGrailsHome() + "/scripts/log4j.properties");
configure.invoke(cls, f.toURI().toURL());
File f = new File(settings.getGrailsHome() + "/grails-scripts/src/main/scripts/log4j.properties");
if(f.exists()) {
configure.invoke(cls, f.toURI().toURL());
}
else {
f = new File(settings.getGrailsHome() + "/scripts/log4j.properties");
configure.invoke(cls, f.toURI().toURL());
}
} catch (Throwable e) {
console.verbose("Log4j was not found on the classpath and will not be used for command line logging. Cause "+e.getClass().getName()+": " + e.getMessage());
}
Expand Down

0 comments on commit 6303356

Please sign in to comment.