Yes, define log4j.configuration
property
java -Dlog4j.configuration=file:/path/to/log4j.properties myApp
Note, that property value must be a URL.
For more read section ‘Default Initialization Procedure’ in Log4j manual.
More Related Contents:
- Creating multiple log files of different content with log4j
- How to create my own Appender in log4j?
- log4j: Log output of a specific class to a specific appender
- log4j: How to use SocketAppender?
- In log4j, does checking isDebugEnabled before logging improve performance?
- Dynamically Changing log4j log level
- How to send java.util.logging to log4j?
- How to give dynamic file name in the appender in log4j.xml
- Initializing Log4J with Spring?
- Conditional logging with log4j
- Set System Property With Spring Configuration File
- Compress Log4j files
- Disabling Log4J Output in Java
- How to mask credit card numbers in log files with Log4J?
- Java Logging vs Log4J [closed]
- How to send a stacktrace to log4j?
- Migrating from log4j to log4j2 – properties file configuration
- How to delete old logs with log4j2
- Where is the correct location to put Log4j.properties in an Eclipse project?
- Getting Exception org.apache.logging.slf4j.SLF4JLoggerContext cannot be cast to org.apache.logging.log4j.core.LoggerContext
- 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?
- Enable Hibernate logging
- Should log4.properties be on the classpath?
- Java Log Viewer [closed]
- logging with AOP in spring?
- How to create different log files for different packages using same log4j logger?
- Log4j2 (2.1) custom plugin not detected by packages attribute
- Log4J: Strategies for creating Logger instances