Project

Profile

Help

Logging

Added by Anonymous about 17 years ago

Legacy ID: #4204921 Legacy Poster: sarvs (sarvs)

Hi, Earlier I was using saxon8.jar and was using the following code to get the logs from the xslt public static void transform( List<String> argsList ) throws Exception { try { Source xmlSource = new StreamSource( argsList.get( 0 ) ); TransformerHandler handler = new TransformerFactoryImpl().newTransformerHandler( xmlSource ); Controller controller = ( Controller ) handler.getTransformer(); StandardErrorListener seHandler = ( StandardErrorListener ) controller.getErrorListener(); seHandler.setErrorOutput( new PrintStream( new FileOutputStream( argsList.get( 1 ) ) ) ); controller.setParameter( "doc", argsList.get( 2 ) ); Emitter emitter = controller.getMessageEmitter(); if ( emitter==null ) { emitter = controller.makeMessageEmitter(); emitter.setWriter(getWriter(argsList.get( 1 ))); } controller.transform( xmlSource, new StreamResult( new File( argsList.get( 3 ) ) ) ); } catch( Exception ex ) { ex.printStackTrace(); } } But since I am using log4j and the latest saxon8.jar (version 8.9.0) I am having problems to log anything. Can anyone please help me out here. I want to use if(log.isDebugEnabled) { log.debug(xslt.output); } Is this possible at all? Thanks S


Please register to reply