I am writing a special extension for a ready-made Java web application. The application uses log4j for logging, and I would like to add a new logger and application specifically for my extension. The problem is that the application manages the log4j.properties file, which is dynamically generated based on the selection in the user interface of the admin screen. Since this is a ready-made application, I cannot change the source code. Therefore, if I add my own registrar and appender (s) to the file, it will be overwritten at any time when the administrator changes the logging settings in the user interface.
Is it possible to get log4j for its configuration from 2 files? For example, I would like something like the following:
applog.properties
mylog.properties
In this case, log4j will somehow combine the entries from both files for a complete configuration.
Is it possible? or are there other workarounds?
source
share