KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > pluto > portalImpl > services > log > LogServiceImpl


1 /*
2  * Copyright 2003,2004 The Apache Software Foundation.
3  *
4  * Licensed under the Apache 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.apache.org/licenses/LICENSE-2.0
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 /*
17
18  */

19
20 package org.apache.pluto.portalImpl.services.log;
21
22 import org.apache.commons.logging.LogFactory;
23 import org.apache.pluto.services.log.Logger;
24
25 /** LogService implementation which uses Commons Logging.
26  * The use of commons logging provides us with a simple yet
27  * effective way to abstract the logging implementation. Commons
28  * Logging will be initialized in it's default manner according
29  * to: http://jakarta.apache.org/commons/logging/userguide.html.
30  *
31  * If no configuraiton is found, Commons Logging will use it's
32  * SimpleLog configuration, which will log everything to standard
33  * error.
34  */

35 public class LogServiceImpl
36     extends LogService {
37
38     public Logger getLogger(String JavaDoc component) {
39         return new LoggerImpl(
40             LogFactory.getLog(component)
41         );
42
43     }
44
45     public Logger getLogger(Class JavaDoc klass) {
46         return new LoggerImpl(
47             LogFactory.getLog(klass)
48         );
49     }
50
51 }
52
Popular Tags