[ create a new paste ] login | about

Link: http://codepad.org/s3fKnhLP    [ raw code | fork ]

hron84 - C++, pasted on Nov 6:
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package hu.raiwayhosting.helper.logging;

import oracle.toplink.essentials.logging.AbstractSessionLog;
import oracle.toplink.essentials.logging.SessionLogEntry;
import org.apache.log4j.Level;
import org.apache.log4j.Logger;

/**
 *
 * @author hron
 */
public class Log4JSessionLog extends AbstractSessionLog {

    Level[] levels =  { Level.ALL, Level.TRACE, Level.TRACE, Level.TRACE, Level.TRACE, Level.INFO, Level.WARN, Level.ERROR, Level.OFF };
    @Override
    public void log(SessionLogEntry entry) {
        Logger logger = LogManager.getLogger();
        logger.log(levels[entry.getLevel()], formatMessage(entry));
        
    }

}


Create a new paste based on this one


Comments: