Return-Path: Delivered-To: apmail-xml-cocoon-dev-archive@xml.apache.org Received: (qmail 46989 invoked by uid 500); 3 Apr 2001 19:45:51 -0000 Mailing-List: contact cocoon-dev-help@xml.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: list-post: Reply-To: cocoon-dev@xml.apache.org Delivered-To: mailing list cocoon-dev@xml.apache.org Received: (qmail 46949 invoked from network); 3 Apr 2001 19:45:51 -0000 Date: Tue, 3 Apr 2001 14:55:30 -0400 (EDT) From: Donald Ball X-Sender: To: Subject: question on getLogger() Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Spam-Rating: h31.sny.collab.net 1.6.2 0/1000/N i thought i'd try my hand at a little LoggingEntityResolver so that we can try to track file/uri dependencies for the various sitemap components. unfortunately, i'm having trouble getting access to the Logger - getLogger() returns null. here's my sample code: package org.apache.cocoon.xml; import org.xml.sax.EntityResolver; import org.xml.sax.InputSource; import org.xml.sax.SAXException; import java.io.IOException; import org.apache.log.Logger; import org.apache.avalon.AbstractLoggable; import org.apache.avalon.configuration.Configurable; import org.apache.avalon.configuration.Configuration; import org.apache.avalon.configuration.ConfigurationException; public class LoggingEntityResolver extends AbstractLoggable implements EntityResolver,Configurable { protected EntityResolver resolver; public LoggingEntityResolver(EntityResolver resolver) { this.resolver = resolver; } public void configure(Configuration conf) throws ConfigurationException {} public InputSource resolveEntity(String public_id, String system_id) throws SAXException,IOException { InputSource input_source = resolver.resolveEntity(public_id,system_id); StringBuffer sb = new StringBuffer(); sb.append("Resolving entity: "); if (public_id != null) { sb.append("public_id: "+public_id); } if (system_id != null) { sb.append("system_id: "+system_id); } if (input_source != null) { sb.append("input_source: "+input_source.toString()); } getLogger().debug(sb.toString()); return input_source; } } what's the most succinct way of configuring the class so that getLogger() is valid and doesn't return null? - donald --------------------------------------------------------------------- To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org For additional commands, email: cocoon-dev-help@xml.apache.org