View Javadoc
1 /* ====================================================================
2 * License:
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
6 * are met:
7 *
8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 *
11 * 2. Redistributions in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer in
13 * the documentation and/or other materials provided with the
14 * distribution.
15 *
16 * 3. The end-user documentation included with the redistribution,
17 * if any, must include the following acknowledgment:
18 * "This product includes software developed by
19 * Robert Half International (http://www.rhi.com/)."
20 * Alternately, this acknowledgment may appear in the software itself,
21 * if and wherever such third-party acknowledgments normally appear.
22 *
23 * 4. The names "Parc", "RHI", and "Robert Half International" must
24 * not be used to endorse or promote products derived from this
25 * software without prior written permission. For written
26 * permission, please contact pete.mckinstry@rhi.com.
27 *
28 * 5. Products derived from this software may not be called "PARC",
29 * nor may "PARC" appear in their name, without prior written
30 * permission of Robert Half International.
31 *
32 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
33 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
34 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
35 * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
36 * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
37 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
38 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
39 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
40 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
41 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
42 * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
43 * SUCH DAMAGE.
44 * ====================================================================
45 *
46 */
47 package com.rhi.architecture.logging;
48
49 import com.rhi.architecture.resource.InitializationException;
50 import com.rhi.architecture.resource.Resource;
51
52 import java.util.Properties;
53
54 /***
55 * Logger interface
56 *
57 * @author Pete McKinstry
58 * @copyright 2002, Robert Half Int'l., Inc. All rights reserved.
59 *
60 * @since 1.2
61 */
62 public abstract class Logger implements Resource {
63
64 /***
65 * ResourceContext key used to load correct Logger type
66 */
67 public static final String KEY = "Resource.Logger";
68
69 /***
70 * default category to use
71 */
72 public static final String DEFAULT_CATEGORY = "DEFAULT";
73
74 /***
75 * Perform whatever initialization is required of the resource.
76 *
77 * @param p
78 * @throws InitializationException
79 * @since 1.2
80 */
81 public abstract void init(Properties p) throws InitializationException;
82
83 /***
84 * Perform whatever cleanup is required of the underlying object..
85 *
86 * @since 1.2
87 */
88 public abstract void close();
89
90 /***
91 * Log a message w/ a fatal priority. Fatal messages are
92 * usually not recoverable & will precede an application
93 * shutdown. Actual support for this priority is log
94 * implementation specific, but should be available in
95 * most packages. (e.g. Log4J, JDK1.4)
96 *
97 * @param message - log message
98 *
99 * @since 1.0
100 */
101 public abstract void fatal(String message);
102
103 /***
104 * Log a message w/ a fatal priority. Fatal messages are
105 * usually not recoverable & will precede an application
106 * shutdown. Actual support for this priority is log
107 * implementation specific, but should be available in
108 * most packages. (e.g. Log4J, JDK1.4)
109 *
110 * @param message - log message
111 * @param t - exception causing fatal error
112 *
113 * @since 1.0
114 */
115 public abstract void fatal(String message, Throwable t);
116
117 /***
118 * Log a message w/ an error priority. Errors are used for
119 * problems found during processing that are not fatal. Actual
120 * support for this priority is log implementation specific,
121 * but should be available in most packages. (e.g. Log4J,
122 * JDK1.4)
123 *
124 * @param message - log message
125 *
126 * @since 1.0
127 */
128 public abstract void error(String message);
129
130 /***
131 * Log a message w/ an error priority. Errors are used for
132 * problems found during processing that are not fatal. Actual
133 * support for this priority is log implementation specific,
134 * but should be available in most packages. (e.g. Log4J,
135 * JDK1.4)
136 *
137 * @param message - log message
138 * @param t - exception causing error
139 *
140 * @since 1.0
141 */
142 public abstract void error(String message, Throwable t);
143
144 /***
145 * Log a message w/ a warning priority. Warnings are useful
146 * for messages that signal an error in the future if not
147 * corrected. (e.g. low disk space) or potential errors that
148 * may not be a problem depending on context that the logging
149 * component does not have. Actual support for this priority
150 * is log implementation specific, but should be available in
151 * most packages. (e.g. Log4J, JDK1.4)
152 *
153 * @param message - log message
154 *
155 * @since 1.01
156 */
157 public abstract void warning(String message);
158
159 /***
160 * Check whether this category is enabled for the WARNING Level.
161 *
162 * @return boolean
163 *
164 * @since 1.0
165 */
166 public abstract boolean isWarningEnabled();
167
168 /***
169 * Log a message w/ an informational priority. Informational
170 * messages will include things like operational statistics,
171 * which are nice to have, but don't signal an error of any
172 * kind in the application. The number of informational
173 * messages used in a process should be very low. Actual
174 * support for this priority is log implementation specific,
175 * but should be available in most packages. (e.g. Log4J,
176 * JDK1.4)
177 *
178 * @param message - log message
179 *
180 * @since 1.01
181 */
182 public abstract void info(String message);
183
184 /***
185 * Check whether this category is enabled for the INFO Level.
186 *
187 * @return boolean
188 *
189 * @since 1.0
190 */
191 public abstract boolean isInfoEnabled();
192
193 /***
194 * Log a message w/ a debug priority. Debug messages are
195 * normally be disabled in production environments, but
196 * can be quite useful during development.
197 *
198 * @param message - log message
199 *
200 * @since 1.01
201 */
202 public abstract void debug(String message);
203
204 /***
205 * Check whether this category is enabled for the DEBUG Level.
206 *
207 * @return boolean
208 *
209 * @since 1.0
210 */
211 public abstract boolean isDebugEnabled();
212
213 /***
214 * Log a message w/ a trace priority. Trace messages are the
215 * most granular and will normally be disabled in production
216 * environments, but can be quite useful during development.
217 * If the underlying logging implementation does not support
218 * this level, trace messages should be logged w/ the most
219 * verbose logging level available.
220 *
221 * @param message - log message
222 *
223 * @since 1.01
224 */
225 public abstract void trace(String message);
226
227 /***
228 * Check whether this category is enabled for the TRACE Level.
229 *
230 * @return boolean
231 *
232 * @since 1.0
233 */
234 public abstract boolean isTraceEnabled();
235
236 }
This page was automatically generated by Maven