Skip to content

Commit

Permalink
bugfix[#2180]:sometime cant load the log config file properly
Browse files Browse the repository at this point in the history
  • Loading branch information
moshoujingli committed Jun 21, 2018
1 parent cd5f51c commit 88b8df1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions framework/src/play/Logger.java
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,12 @@ public class Logger {
*/
public static void init() {
String log4jPath = Play.configuration.getProperty("application.log.path", "/log4j.xml");
URL log4jConf = Logger.class.getResource(log4jPath);
URL log4jConf = Thread.currentThread().getContextClassLoader().getResource(log4jPath);
boolean isXMLConfig = log4jPath.endsWith(".xml");
if (log4jConf == null) { // try again with the .properties
isXMLConfig = false;
log4jPath = Play.configuration.getProperty("application.log.path", "/log4j.properties");
log4jConf = Logger.class.getResource(log4jPath);
log4jConf = Thread.currentThread().getContextClassLoader().getResource(log4jPath);
}
if (log4jConf == null) {
Properties shutUp = new Properties();
Expand Down

0 comments on commit 88b8df1

Please sign in to comment.