Can multiple config files be read when initializing log4j? For example, in my case, I am using WebLogic 8.1 and they have a default log4j config xml file that is read to initialize log4j. If I want to add specific configuration for my application, would I have to add to the existing WL log4j config, or could I have my own config file that is specific to my application? When I have my own config file, my goal is really to keep the logging that WL provides, but to ALSO include the logging config for my app. I know that I can rename the file and just point to the new file, I just want to be able to keep all of my app-specific configuration in one place, and the WL configuration in another, for ease of maintenence.
In summary, I guess I have the following questions:
Can multiple config files be read for log4j? If so, what happens?
- Does the config file that is loaded 2nd overwrite the 1st, or append to the first (provided there are no conflicts)
- Can the config files be a mix of xml and .properties files?
- Can they be loaded at different times (e.g. WL loads its default at server startup, but have my app-specific file loaded via an initialization servlet that reads a properties file via PropertyConfigurator.configure() ) ?
Thanks in advance for any input you may be able to provide.
In summary, I guess I have the following questions:
Can multiple config files be read for log4j? If so, what happens?
- Does the config file that is loaded 2nd overwrite the 1st, or append to the first (provided there are no conflicts)
- Can the config files be a mix of xml and .properties files?
- Can they be loaded at different times (e.g. WL loads its default at server startup, but have my app-specific file loaded via an initialization servlet that reads a properties file via PropertyConfigurator.configure() ) ?
Thanks in advance for any input you may be able to provide.