Can multiple log4j.properties files be used in the same Tomcat web app?

I never did find a way to "merge" multiple log4j. Properties file, but I did find a workable solution. Log4j configuration can be manipulated programatically at runtime similar to the code snippet below.

This effectively merged my custom log4j settings into the configuration defined by the log4j. Properties file, which in my case I couldn't edit.

I never did find a way to "merge" multiple log4j. Properties file, but I did find a workable solution. Log4j configuration can be manipulated programatically at runtime similar to the code snippet below.

This effectively merged my custom log4j settings into the configuration defined by the log4j. Properties file, which in my case I couldn't edit. // Init custom logging // Define layout PatternLayout layout = new PatternLayout(); layout.

SetConversionPattern("%d %-5p -- %m%n"); // Create appender RollingFileAppender appender = new RollingFileAppender(); appender. SetFile(LOG_PATH); appender. SetMaxFileSize("2MB"); appender.

SetMaxBackupIndex(0); appender. SetLayout(layout); appender.activateOptions(); // It didn't work without this // Get our logger and add appender. Log = Logger.

GetLogger("MyCustomLogger"); log. SetLevel(YOUR_LOGGING_LEVEL_HERE); log. AddAppender(appender).

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions