DZone Forums
Go Back   DZone Forums > Community > Languages & Frameworks > Java
Reload this Page log4j xml configuration
Notices
Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  (#1 (permalink)) Old
Member
 
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Join Date: Apr 2010
Smile log4j xml configuration - 04-13-2010, 08:00 AM

Hi,
I am new to log4j and xml !
I configured log4j in my j2ee application using log4j.xml file now I have a requirement to read param values for xml configuration using a database table is it possible ??
<appender name="debugfile" class="org.apache.log4j.RollingFileAppender">
<param name="maxFileSize" value= **this i want from database
<param name="maxBackupIndex" value=**this i want from database
<param name="File" value=**this i want from database


please help me out

Thanks in advance !!!
Reply With Quote
  (#2 (permalink)) Old
Member
 
Posts: 28
Thanks: 0
Thanked 3 Times in 3 Posts
Join Date: Feb 2008
Default 04-14-2010, 12:30 PM

By default, Log4J reads configuration information from properties or xml files, as you've seen.

You could always load your XML configuration and populate the runtime parameters with your DB values. Then you could use one of the DOMConfigurator.doConfigure() methods to configure your Log4J.
Reply With Quote
Reply

Tags
cofiguration, dynamic, log4j, xml

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I configure default run configuration variables? belliveau Eclipse 0 11-03-2009 04:25 PM
Need 'Run-Configuration' Type Functionality dfrenette Eclipse 1 05-20-2009 01:39 PM
Tomcat configuration in Eclipse ados Eclipse 1 05-06-2009 11:38 AM
Java Configuration problem ??? bigYetti Java 3 02-24-2009 12:06 PM
Confusion in using log4j raziuddincse Java 2 02-25-2008 09:37 AM


Copyright 1997-2009, DZone, Inc.
vBulletin Skin developed by: vBStyles.com