View Javadoc
1   /*
2    * Copyright 2011 The Kuali Foundation.
3    * 
4    * Licensed under the Educational Community License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    * 
8    * http://www.opensource.org/licenses/ecl2.php
9    * 
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  package org.kuali.ole.logger;
17  
18  
19  import org.slf4j.Logger;
20  import org.slf4j.LoggerFactory;
21  
22  public class DocStoreLogger {
23      private Logger logger;
24  
25      public DocStoreLogger(String loggingClassName) {
26          try {
27              logger = LoggerFactory.getLogger(Class.forName(loggingClassName));
28  
29          } catch (ClassNotFoundException e) {
30              System.out.println("ClassNotFoundException: " + e.getMessage());
31          }
32      }
33  
34      public void log(String logMessage) {
35          logger.info(logMessage);
36      }
37  
38      public void log(String logMessage, Exception e) {
39          logger.error(logMessage + e.getMessage());
40      }
41  
42      public void logDebugMsg(String logMessage) {
43          logger.debug(logMessage);
44      }
45  }