I generally just put a log4j.xml file into src/test/resources and let log4j find it by itself: no code required, the default log4j initialisation will pick it up. (I typically want to set my own loggers to ‘DEBUG’ anyway)
More Related Contents:
- Setting a log file name to include current date in Log4j
- How to do a JUnit assert on a message in a logger
- log4j: Log output of a specific class to a specific appender
- In log4j, does checking isDebugEnabled before logging improve performance?
- Dynamically Changing log4j log level
- Is it worth to use slf4j with log4j2
- How to send java.util.logging to log4j?
- Set System Property With Spring Configuration File
- Log4j: How to configure simplest possible file logging?
- Disabling Log4J Output in Java
- Java Logging vs Log4J [closed]
- How to send a stacktrace to log4j?
- How to delete old logs with log4j2
- How to configure log4j to log different log levels to different files for the same logger
- How to customize log4j2 RollingFileAppender?
- Are there technical reasons to prefer using logback instead of log4j?
- How to specify Log4J 2.x config location?
- LOG4J: Modify logged message using custom appender
- Log4j formatting: Is it possible to truncate stacktraces?
- How to exclude a single Class from a Log4j Logger / Appender?
- Configuring log4j2 and log4j using a single log4j2 xml file
- Log runtime Exceptions in Java using log4j
- Enable Hibernate logging
- How to configure log4j to only keep log files for the last seven days?
- Log4J2 property substitution – default
- Why chose XML over properties files for Log4J configuration?
- How to create different log files for different packages using same log4j logger?
- Log4j2 (2.1) custom plugin not detected by packages attribute
- log4j migration to log4j2
- Log4J: Strategies for creating Logger instances