1 16 17 package org.apache.log4j.lf5; 18 19 import org.apache.log4j.PropertyConfigurator; 20 import org.apache.log4j.spi.Configurator; 21 import org.apache.log4j.spi.LoggerRepository; 22 23 import java.io.IOException ; 24 import java.net.URL ; 25 26 38 39 41 public class DefaultLF5Configurator implements Configurator { 42 46 50 54 63 private DefaultLF5Configurator() { 64 65 } 66 67 76 public static void configure() throws IOException { 77 String resource = 78 "/org/apache/log4j/lf5/config/defaultconfig.properties"; 79 URL configFileResource = 80 DefaultLF5Configurator.class.getResource(resource); 81 82 if (configFileResource != null) { 83 PropertyConfigurator.configure(configFileResource); 84 } else { 85 throw new IOException ("Error: Unable to open the resource" + 86 resource); 87 } 88 89 } 90 91 95 public void doConfigure(URL configURL, LoggerRepository repository) { 96 throw new IllegalStateException ("This class should NOT be" + 97 " instantiated!"); 98 } 99 100 104 108 112 } | Popular Tags |