|
From: Michael K. <ko...@us...> - 2006-10-18 16:49:24
|
Update of /cvsroot/cobricks/cobricks2/src/org/cobricks/portal/velocity In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv23857/portal/velocity Added Files: CustomLogger.java Log Message: --- NEW FILE: CustomLogger.java --- /* * Copyright (c) 2006 Cobricks Group. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted under the terms of the Cobricks Software * License, either version 1.0 of the License, or (at your option) any * later version (see www.cobricks.org). * * The above copyright notice and this permission notice shall be * included in all copies or substantial portions of the Software. */ package org.cobricks.portal.velocity; import org.apache.velocity.app.Velocity; import org.apache.velocity.runtime.log.LogSystem; import org.apache.velocity.runtime.RuntimeServices; import org.apache.log4j.Logger; public class CustomLogger implements LogSystem { static Logger logger = Logger.getLogger(CustomLogger.class); public CustomLogger() { } /** * This init() will be invoked once by the LogManager * to give you current RuntimeServices intance */ public void init( RuntimeServices rsvc ) { } /** * This is the method that you implement for Velocity to call * with log messages. */ public void logVelocityMessage(int level, String message) { if (level <=1) { logger.debug(message); return; } if (message.startsWith("Parser Exception:")) { return; } logger.error(message+" ("+level+")"); } } |