01: /*
02: * This is the MIT license, see also http://www.opensource.org/licenses/mit-license.html
03: *
04: * Copyright (c) 2001 Brian Pitcher
05: *
06: * Permission is hereby granted, free of charge, to any person obtaining a
07: * copy of this software and associated documentation files (the "Software"),
08: * to deal in the Software without restriction, including without limitation
09: * the rights to use, copy, modify, merge, publish, distribute, sublicense,
10: * and/or sell copies of the Software, and to permit persons to whom the
11: * Software is furnished to do so, subject to the following conditions:
12: *
13: * The above copyright notice and this permission notice shall be included in
14: * all copies or substantial portions of the Software.
15: *
16: * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17: * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18: * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19: * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20: * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21: * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22: * SOFTWARE.
23: */
24:
25: // $Header: /cvsroot/weblech/weblech/src/weblech/util/Log4j.java,v 1.3 2001/10/21 16:36:44 weblech Exp $
26: package weblech.util;
27:
28: import org.apache.log4j.*;
29:
30: import java.io.IOException;
31:
32: public class Log4j {
33: private static Category _logClass = Category
34: .getInstance(Log4j.class);
35:
36: static {
37: Layout l = new PatternLayout("%d [%t] %-5p %F:%L - %m\n");
38: ConsoleAppender capp = new ConsoleAppender(l);
39: capp.setThreshold(Priority.INFO);
40: BasicConfigurator.configure(capp);
41: try {
42: FileAppender fapp = new FileAppender(l, "weblech.log",
43: false);
44: BasicConfigurator.configure(fapp);
45: System.err
46: .println("Log4j configured to use weblech.log -- view full logging here");
47: } catch (IOException ioe) {
48: _logClass.warn("IO Exception when configuring log4j: "
49: + ioe.getMessage(), ioe);
50: }
51: _logClass.debug("Log4j configured");
52: }
53:
54: public static void init() {
55:
56: }
57: }
|