Source code: org/apache/axis/components/logger/LogFactory.java
1 /*
2 * Copyright 2001-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 package org.apache.axis.components.logger;
18
19 import org.apache.commons.discovery.tools.DiscoverSingleton;
20 import org.apache.commons.logging.Log;
21
22 import java.security.AccessController;
23 import java.security.PrivilegedAction;
24
25
26 /**
27 * @author Richard A. Sitze
28 */
29 public class LogFactory {
30 /**
31 * Override group context..
32 */
33 private static final org.apache.commons.logging.LogFactory logFactory =
34 getLogFactory();
35
36 public static Log getLog(String name) {
37 return org.apache.commons.logging.LogFactory.getLog(name);
38 }
39
40 private static final org.apache.commons.logging.LogFactory getLogFactory() {
41 return (org.apache.commons.logging.LogFactory)
42 AccessController.doPrivileged(
43 new PrivilegedAction() {
44 public Object run() {
45 return DiscoverSingleton.find(org.apache.commons.logging.LogFactory.class,
46 org.apache.commons.logging.LogFactory.FACTORY_PROPERTIES,
47 org.apache.commons.logging.LogFactory.FACTORY_DEFAULT);
48 }
49 });
50 }
51 }