001 /** 002 * Copyright 2007-2008 Arthur Blake 003 * 004 * Licensed under the Apache License, Version 2.0 (the "License"); 005 * you may not use this file except in compliance with the License. 006 * You may obtain a copy of the License at 007 * 008 * http://www.apache.org/licenses/LICENSE-2.0 009 * 010 * Unless required by applicable law or agreed to in writing, software 011 * distributed under the License is distributed on an "AS IS" BASIS, 012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 013 * See the License for the specific language governing permissions and 014 * limitations under the License. 015 */ 016 package net.sf.log4jdbc; 017 018 /** 019 * A provider for a SpyLogDelegator. This allows a single switch point to abstract 020 * away which logging system to use for spying on JDBC calls. 021 * 022 * The SLF4J logging facade is used, which is a very good general purpose facade for plugging into 023 * numerous java logging systems, simply and easily. 024 * 025 * @author Arthur Blake 026 */ 027 public class SpyLogFactory 028 { 029 /** 030 * Do not allow instantiation. Access is through static method. 031 */ 032 private SpyLogFactory() {} 033 034 /** 035 * The logging system of choice. 036 */ 037 private static final SpyLogDelegator logger = new Slf4jSpyLogDelegator(); 038 //new Log4jSpyLogDelegator(); 039 040 /** 041 * Get the default SpyLogDelegator for logging to the logger. 042 * 043 * @return the default SpyLogDelegator for logging to the logger. 044 */ 045 public static SpyLogDelegator getSpyLogDelegator() 046 { 047 return logger; 048 } 049 } 050