Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  * Copyright 2004 - 2011 Brian McCallister
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * See the License for the specific language governing permissions and
 * limitations under the License.
package org.skife.jdbi.v2.logging;
import  org.apache.log4j.Level;
import  org.apache.log4j.Logger;
import  org.apache.log4j.Priority;
Logs SQL via Log4J
public final class Log4JLog extends FormattedLog
    private final Logger log;
    private Priority level;

Logs to org.skife.jdbi.v2 logger at the debug level
    public Log4JLog()

Use an arbitrary logger to log to at the debug level
    public Log4JLog(Logger log)
        this(log, Level.DEBUG);

Specify both the logger and the priority to log at

log The logger to log to
level the priority to log at
    public Log4JLog(Logger log, Priority level) {
        this. = log;
        this. = level;
    protected final boolean isEnabled()
        return .isEnabledFor();
    protected final void log(String msg)
New to GrepCode? Check out our FAQ X