Changeset 1675


Ignore:
Timestamp:
10/06/11 22:08:51 (8 months ago)
Author:
jharrop
Message:

Allow auto config of log4j to be disabled

Location:
trunk/docx4j/src/main
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/docx4j/src/main/java/org/docx4j/utils/Log4jConfigurator.java

    r1661 r1675  
    77import org.apache.log4j.LogManager; 
    88import org.apache.log4j.Logger; 
     9import org.docx4j.Docx4jProperties; 
    910 
    1011//From http://wiki.apache.org/logging-log4j/UsefulCode 
     
    1314    public synchronized static void configure() { 
    1415        if (!isConfigured()) { 
     16                 
     17                        boolean disabled = Boolean.parseBoolean( 
     18                                        Docx4jProperties.getProperties().getProperty("docx4j.Log4j.Configurator.disabled", "false"));                            
     19                        if (disabled) return; 
     20                 
    1521            BasicConfigurator.configure(); 
    1622         
  • trunk/docx4j/src/main/resources/docx4j.properties

    r1604 r1675  
    2525# 
    2626#docx4j.McPreprocessor=true 
     27 
     28# If you haven't configured log4j yourself 
     29# docx4j will autoconfigure it.  Set this to true to disable that 
     30docx4j.Log4j.Configurator.disabled=false 
Note: See TracChangeset for help on using the changeset viewer.