001: // Copyright 2005 Chibacon
002: /*
003: *
004: * Artistic License
005: *
006: * Preamble
007: *
008: * The intent of this document is to state the conditions under which a
009: * Package may be copied, such that the Copyright Holder maintains some
010: * semblance of artistic control over the development of the package, while
011: * giving the users of the package the right to use and distribute the
012: * Package in a more-or-less customary fashion, plus the right to make
013: * reasonable modifications.
014: *
015: * Definitions:
016: *
017: * "Package" refers to the collection of files distributed by the Copyright
018: * Holder, and derivatives of that collection of files created through
019: * textual modification.
020: *
021: * "Standard Version" refers to such a Package if it has not been modified,
022: * or has been modified in accordance with the wishes of the Copyright
023: * Holder.
024: *
025: * "Copyright Holder" is whoever is named in the copyright or copyrights
026: * for the package.
027: *
028: * "You" is you, if you're thinking about copying or distributing this
029: * Package.
030: *
031: * "Reasonable copying fee" is whatever you can justify on the basis of
032: * media cost, duplication charges, time of people involved, and so
033: * on. (You will not be required to justify it to the Copyright Holder, but
034: * only to the computing community at large as a market that must bear the
035: * fee.)
036: *
037: * "Freely Available" means that no fee is charged for the item itself,
038: * though there may be fees involved in handling the item. It also means
039: * that recipients of the item may redistribute it under the same
040: * conditions they received it.
041: *
042: * 1. You may make and give away verbatim copies of the source form of the
043: * Standard Version of this Package without restriction, provided that
044: * you duplicate all of the original copyright notices and associated
045: * disclaimers.
046: *
047: * 2. You may apply bug fixes, portability fixes and other modifications
048: * derived from the Public Domain or from the Copyright Holder. A
049: * Package modified in such a way shall still be considered the Standard
050: * Version.
051: *
052: * 3. You may otherwise modify your copy of this Package in any way,
053: * provided that you insert a prominent notice in each changed file
054: * stating how and when you changed that file, and provided that you do
055: * at least ONE of the following:
056: *
057: * a) place your modifications in the Public Domain or otherwise make
058: * them Freely Available, such as by posting said modifications to
059: * Usenet * or an equivalent medium, or placing the modifications on a
060: * major * archive site such as ftp.uu.net, or by allowing the Copyright
061: * Holder * to include your modifications in the Standard Version of the
062: * Package.
063: *
064: * b) use the modified Package only within your corporation or *
065: * organization.
066: *
067: * c) rename any non-standard executables so the names do not conflict
068: * with standard executables, which must also be provided, and provide a
069: * separate manual page for each non-standard executable that clearly
070: * documents how it differs from the Standard Version.
071: *
072: * d) make other distribution arrangements with the Copyright Holder.
073: *
074: * 4. You may distribute the programs of this Package in object code or
075: * executable form, provided that you do at least ONE of the following:
076: *
077: * a) distribute a Standard Version of the executables and library
078: * files, together with instructions (in the manual page or equivalent)
079: * on where to get the Standard Version.
080: *
081: * b) accompany the distribution with the machine-readable source of the
082: * Package with your modifications.
083: *
084: * c) accompany any non-standard executables with their corresponding
085: * Standard Version executables, giving the non-standard executables
086: * non-standard names, and clearly documenting the differences in manual
087: * pages (or equivalent), together with instructions on where to get the
088: * Standard Version.
089: *
090: * d) make other distribution arrangements with the Copyright Holder.
091: *
092: * 5. You may charge a reasonable copying fee for any distribution of this
093: * Package. You may charge any fee you choose for support of this
094: * Package. You may not charge a fee for this Package itself. However,
095: * you may distribute this Package in aggregate with other (possibly
096: * commercial) programs as part of a larger (possibly commercial)
097: * software distribution provided that you do not advertise this Package
098: * as a product of your own.
099: *
100: * 6. The scripts and library files supplied as input to or produced as
101: * output from the programs of this Package do not automatically fall
102: * under * the copyright of this Package, but belong to whomever
103: * generated them, * and may be sold commercially, and may be aggregated
104: * with this Package.
105: *
106: * 7. C or perl subroutines supplied by you and linked into this Package
107: * shall not be considered part of this Package.
108: *
109: * 8. The name of the Copyright Holder may not be used to endorse or
110: * promote products derived from this software without specific prior *
111: * written permission.
112: *
113: * 9. THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED
114: * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
115: * MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
116: *
117: */
118: package mc.formgenerator.servlets;
119:
120: import org.apache.log4j.xml.DOMConfigurator;
121:
122: import javax.servlet.ServletException;
123: import javax.servlet.http.HttpServlet;
124: import javax.servlet.http.HttpServletRequest;
125: import javax.servlet.http.HttpServletResponse;
126:
127: /**
128: * Initialization servlet for the log4j system. should be loaded on tomcat
129: * start.
130: *
131: * @author <a href="mailto:gregor@eyestep.org">Gregor Klinke</a>
132: * @version $Id$
133: */
134: public class Log4jInit extends HttpServlet {
135: /**
136: * __UNDOCUMENTED__
137: *
138: * @param req __UNDOCUMENTED__
139: * @param resp __UNDOCUMENTED__
140: */
141: public void doGet(HttpServletRequest req, HttpServletResponse resp) {
142: /* nop - this servlet is used only for log4j initialization */
143: }
144:
145: /**
146: * __UNDOCUMENTED__
147: *
148: * @throws ServletException __UNDOCUMENTED__
149: */
150: public void init() throws ServletException {
151: String file = getInitParameter("log4j-init-file");
152: String path = getServletContext().getRealPath(
153: file.startsWith("/") ? file : ("/" + file));
154:
155: if (path != null) {
156: DOMConfigurator.configure(path);
157: }
158: }
159: }
160:
161: /*
162: $Log$
163: Revision 1.1 2005/06/15 14:57:04 cesterbj
164: needed for formgenerator and chiba log
165:
166: Revision 1.5 2005/01/31 22:49:11 joernt
167: added copyright notice
168:
169: Revision 1.4 2005/01/31 22:30:20 joernt
170: added copyright notice
171:
172: Revision 1.3 2004/08/15 14:14:02 joernt
173: preparing release...
174: -reformatted sources to fix mixture of tabs and spaces
175: -optimized imports on all files
176:
177: Revision 1.2 2003/10/02 15:15:50 joernt
178: applied chiba jalopy settings to whole src tree
179:
180: Revision 1.1 2003/07/12 12:13:17 joernt
181: package refactoring: moved from servlet package
182: Revision 1.2 2003/05/27 17:36:45 unl
183: - adapted latest changes from 0.8
184: Revision 1.1.1.1 2003/05/23 14:54:06 unl
185: no message
186: Revision 1.2 2002/07/28 14:49:38 joernt
187: big cleanup of unused imports, vars and params; unneeded methods removed.
188: Revision 1.1 2001/10/30 14:19:57 gregor
189: added for log4jing
190: */
|