-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Start logging programatically as log4j not started in time
- Loading branch information
amckenzie
committed
Jun 6, 2018
1 parent
d1d979d
commit b6bae67
Showing
6 changed files
with
45 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
...-tools-replay/src/main/java/uk/gov/justice/framework/tools/replay/LoggerConfigurator.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package uk.gov.justice.framework.tools.replay; | ||
|
||
import static org.apache.log4j.Level.DEBUG; | ||
import static org.apache.log4j.Level.INFO; | ||
import static org.apache.log4j.Level.WARN; | ||
|
||
import org.apache.log4j.Logger; | ||
import org.apache.log4j.spi.LoggerRepository; | ||
|
||
public class LoggerConfigurator { | ||
|
||
public void startLoggingProgramaticallyAsLog4JNotYetStarted() { | ||
final Logger rootLogger = Logger.getRootLogger(); | ||
rootLogger.setLevel(INFO); | ||
final LoggerRepository loggerRepository = rootLogger.getLoggerRepository(); | ||
|
||
loggerRepository.getLogger("uk.gov.justice").setLevel(DEBUG); | ||
loggerRepository.getLogger("org.hibernate").setLevel(WARN); | ||
loggerRepository.getLogger("org.apache.deltaspike").setLevel(WARN); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters