eu.planets_project.pp.plato.util.PlatoLogger.java Source code

Java tutorial

Introduction

Here is the source code for eu.planets_project.pp.plato.util.PlatoLogger.java

Source

/*******************************************************************************
 * Copyright (c) 2006-2010 Vienna University of Technology, 
 * Department of Software Technology and Interactive Systems
 *
 * All rights reserved. This program and the accompanying
 * materials are made available under the terms of the
 * Apache License, Version 2.0 which accompanies
 * this distribution, and is available at
 * http://www.apache.org/licenses/LICENSE-2.0 
 *******************************************************************************/
package eu.planets_project.pp.plato.util;

import java.net.URL;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.log4j.helpers.Loader;
import org.apache.log4j.xml.DOMConfigurator;

public class PlatoLogger {

    public static void configure() {
        URL url = Loader.getResource("log4j.xml");
        DOMConfigurator.configure(url);
    }

    public static Log getLogger(Class clazz) {
        return LogFactory.getLog(clazz);
    }
}