Package org.apache.turbine.services.logging

Examples of org.apache.turbine.services.logging.LoggingService


     * This method has been deprecated, attempts to shutdown logger service.
     * @deprecated The service should be shut down by the broker class only.
     */
    public static void destroy()
    {
        LoggingService logger = (LoggingService)TurbineServices.getInstance()
            .getService(LoggingService.SERVICE_NAME);
        logger.shutdown();
    }
View Full Code Here


     *
     * @return The default logger for system.
     */
    public static Logger getLogger()
    {
        LoggingService logger = (LoggingService)TurbineServices.getInstance()
            .getService(LoggingService.SERVICE_NAME);
        return logger.getLogger();
    }
View Full Code Here

     * This method returns logger with given name if such logger exsists,
     * or the default logger.
     */
    public static Logger getLogger(String logName)
    {
        LoggingService logger = (LoggingService)TurbineServices.getInstance()
            .getService(LoggingService.SERVICE_NAME);
        return logger.getLogger(logName);
    }
View Full Code Here

    /**
     * This method sets the log level in default logger
     */
    public static void setLogLevel(int level)
    {
        LoggingService logger = (LoggingService)TurbineServices.getInstance()
            .getService(LoggingService.SERVICE_NAME);
        logger.setLogLevel(level);
    }
View Full Code Here

    /**
     * This method sets the log level in the logger of given name
     */
    public static void setLogLevel(String logName, int level)
    {
        LoggingService logger = (LoggingService)TurbineServices.getInstance()
            .getService(LoggingService.SERVICE_NAME);
        logger.setLogLevel(logName, level);
    }
View Full Code Here

     * @param format String describing what information should be extracted from
     *        RunData
     */
    public static void setFormat(String format)
    {
        LoggingService logger = (LoggingService)TurbineServices.getInstance()
            .getService(LoggingService.SERVICE_NAME);
        logger.setFormat(format);
    }
View Full Code Here

     */
    public void notice(String msg)
    {
        if (enabledLogging)
        {
            LoggingService logger = getLogger();
            if (logger == null)
            {
                System.out.println("(!) NOTICE: " + msg);
            }
            else
            {
                logger.info(msg);
            }
        }
        else
        {
            System.out.println("NOTICE: " + msg);
View Full Code Here

     * @param format String describing what information should be extracted from
     *        RunData
     */
    public static void setFormat(String logName, String format)
    {
        LoggingService logger = (LoggingService)TurbineServices.getInstance()
            .getService(LoggingService.SERVICE_NAME);
        logger.setFormat(logName, format);
    }
View Full Code Here

     */
    public void error(Throwable t)
    {
        if (enabledLogging)
        {
            LoggingService logger = getLogger();
            if (logger == null)
            {
                System.out.println("(!) ERROR: " + t.getMessage());
            }
            else
           
                logger.error("", t);
            }
        }
        else
        {
            System.out.println("ERROR: " + t.getMessage());
View Full Code Here

     * Allows logging using a logging service instead of console
     * This method should be called after initialization of the logging service
     */
    private void enableLogging()
    {
        LoggingService logger = getLogger();
        if (logger != null)
        {
            logger.info("ServiceBroker: LoggingService enabled.");
            enabledLogging = true;
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.turbine.services.logging.LoggingService

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.