Sample XML files sample1.xml and sample2.xml are provided.
Note that the log4j.dtd is not in the local directory. It is found by the class loader.
System.err.println(msg); System.err.println( "Usage: java " + XMLSample.class.getName() + "configFile"); System.exit(1);
DOMConfigurator.configure(configFile);
if(argv.length == 1) init(argv[0]); else Usage("Wrong number of arguments."); sample();
int i = -1; cat.debug("Message " + ++i); cat.warn ("Message " + ++i); cat.error("Message " + ++i); Exception e = new Exception("Just testing"); cat.debug("Message " + ++i, e);