Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can multiple config files be read when initializing log4j?

Status
Not open for further replies.

woodtah

Programmer
Jul 8, 2005
1
US
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.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top