1 package org.apache.turbine.services.logging;
2
3 /* ====================================================================
4 * The Apache Software License, Version 1.1
5 *
6 * Copyright (c) 2001 The Apache Software Foundation. All rights
7 * reserved.
8 *
9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions
11 * are met:
12 *
13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer.
15 *
16 * 2. Redistributions in binary form must reproduce the above copyright
17 * notice, this list of conditions and the following disclaimer in
18 * the documentation and/or other materials provided with the
19 * distribution.
20 *
21 * 3. The end-user documentation included with the redistribution,
22 * if any, must include the following acknowledgment:
23 * "This product includes software developed by the
24 * Apache Software Foundation (http://www.apache.org/)."
25 * Alternately, this acknowledgment may appear in the software itself,
26 * if and wherever such third-party acknowledgments normally appear.
27 *
28 * 4. The names "Apache" and "Apache Software Foundation" and
29 * "Apache Turbine" must not be used to endorse or promote products
30 * derived from this software without prior written permission. For
31 * written permission, please contact apache@apache.org.
32 *
33 * 5. Products derived from this software may not be called "Apache",
34 * "Apache Turbine", nor may "Apache" appear in their name, without
35 * prior written permission of the Apache Software Foundation.
36 *
37 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
38 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
39 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
40 * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
41 * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
42 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
43 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
44 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
45 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
46 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
47 * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
48 * SUCH DAMAGE.
49 * ====================================================================
50 *
51 * This software consists of voluntary contributions made by many
52 * individuals on behalf of the Apache Software Foundation. For more
53 * information on the Apache Software Foundation, please see
54 * <http://www.apache.org/>.
55 */
56
57 import org.apache.turbine.util.RunData;
58
59 /***
60 * Classes that implement the Logger interface allows loging.
61 * There is set of standart printing methods (info, debug ...).
62 * The implementation has to read xml-node describing properities,
63 * skiping options that are not recognizeable.
64 *
65 * <p>Uh, we need better javadoc here (Rafal)<br>
66 *
67 * @author <a href="mailto:Tomasz.Zielinski@e-point.pl">Tomasz Zielinski</a>
68 * @author <a href="mailto:jon@latchkey.com">Jon S. Stevens</a>
69 * @version $Id: Logger.java,v 1.1.1.1 2001/08/16 05:09:04 jvanzyl Exp $
70 */
71 public interface Logger
72 {
73 /***Log level*/
74 public static final int DEBUG = 1;
75 /***Log level*/
76 public static final int INFO = 2;
77 /***Log level*/
78 public static final int WARN = 3;
79 /***Log level*/
80 public static final int ERROR = 4;
81
82 /*** String denoting log level */
83 public static final String LEVELDEBUG = "DEBUG";
84 /*** String denoting log level */
85 public static final String LEVELINFO = "INFO";
86 /*** String denoting log level */
87 public static final String LEVELWARN = "WARN";
88 /*** String denoting log level */
89 public static final String LEVELERROR = "ERROR";
90
91 /*** Destination type - file */
92 public static final String FILE_KEY = "file";
93 /*** Destination type - syslogdemon */
94 public static final String SYSLOGD_KEY = "syslogd";
95 /*** Destination type - remote server */
96 public static final String REMOTE_KEY = "remote";
97 /*** Destination type - console */
98 public static final String CONSOLE_KEY = "console";
99 /*** Destination type - email */
100 public static final String EMAIL_KEY = "email";
101 /*** Destination type - db */
102 public static final String DB_KEY = "database";
103
104 /*** Destination parameter - format */
105 public static final String FORMAT_KEY = "format";
106 /*** Destination parameter - file path */
107 public static final String PATH_KEY = "path";
108 /*** Destination parameter - remote url */
109 public static final String HOST_KEY = "host";
110 /*** Destination parameter - remote port */
111 public static final String PORT_KEY = "port";
112 /*** Destination parameter - syslogd facility */
113 public static final String FACILITY_KEY = "facility";
114 /*** Destination parameter - rollover file size */
115 public static final String SIZE_KEY = "file.size";
116 /*** Destination parameter - number of backup files */
117 public static final String BACKUP_KEY = "file.backups";
118 /*** Destination parameter - email from */
119 public static final String EMAILFROM_KEY = "from";
120 /*** Destination parameter - email to */
121 public static final String EMAILTO_KEY = "to";
122 /*** Destination parameter - email subject */
123 public static final String EMAILSUBJECT_KEY = "subject";
124 /*** Destination parameter - email buffer size */
125 public static final String EMAILBUFFERSIZE_KEY = "buffer.size";
126 /*** Destination parameter - db sql */
127 public static final String DB_LOGGER_KEY = "logger";
128 public static final String DB_POOL_KEY = "pool";
129
130 /*** name of the logger */
131 public String getName();
132
133 /*** Setings the name */
134 public void setName(String logName);
135
136 /***
137 * This method sets parameters for the logger implementation.
138 * If the implementation cannot handle some type of destination should ignore
139 * that output.
140 *
141 * @param LoggingConfig configuration object for logging
142 */
143 public void init(LoggingConfig loggingConfig);
144
145 /*** Close all destinations*/
146 public void shutdown();
147
148 /***
149 * Sets log level for the logger
150 */
151 public void setLogLevel(int level);
152
153 /***
154 * Checks if DEBUG statements are enabled.
155 */
156 public boolean isDebugEnabled();
157
158 /***
159 * Checks if INFO statements are enabled.
160 */
161 public boolean isInfoEnabled();
162
163 /***
164 * Checks if WARN statements are enabled.
165 */
166 public boolean isWarnEnabled();
167
168 /***
169 * Checks if ERROR statements are enabled.
170 */
171 public boolean isErrorEnabled();
172
173 /***
174 * This method should be implemented by user.
175 * It performs action that are need for deterimne whether
176 * logger was well configured or has any output
177 */
178 public boolean checkLogger();
179
180 /***
181 * Sets format style for extracting data from RunData
182 */
183 public void setFormat(String format);
184
185 /***
186 * This is a log metod with logLevel == DEBUG
187 */
188 public void debug(String message);
189
190 /***
191 * This is a log metod with logLevel == DEBUG
192 */
193 public void debug(String message, Throwable t);
194
195 /***
196 * This is a log metod with logLevel == DEBUG
197 */
198 public void debug(String message, RunData data);
199
200 /***
201 * This is a log metod with logLevel == DEBUG
202 */
203 public void debug(String message, RunData data, Throwable t);
204
205 /***
206 * This is a log metod with logLevel == INFO
207 */
208 public void info(String message);
209
210 /***
211 * This is a log metod with logLevel == INFO
212 */
213 public void info(String message, Throwable t);
214
215 /***
216 * This is a log metod with logLevel == INFO
217 */
218 public void info(String message, RunData data);
219
220 /***
221 * This is a log metod with logLevel == INFO
222 */
223 public void info(String message, RunData data, Throwable t);
224
225 /***
226 * This is a log metod with logLevel == WARN
227 */
228 public void warn(String message);
229
230 /***
231 * This is a log metod with logLevel == WARN
232 */
233 public void warn(String message, Throwable t);
234
235 /***
236 * This is a log metod with logLevel == WARN
237 */
238 public void warn(String message, RunData data);
239
240 /***
241 * This is a log metod with logLevel == WARN
242 */
243 public void warn(String message, RunData data, Throwable t);
244
245 /***
246 * This is a log metod with logLevel == ERROR
247 */
248 public void error(String message);
249
250 /***
251 * This is a log metod with logLevel == ERROR
252 */
253 public void error(String message, Throwable e);
254
255 /***
256 * This is a log metod with logLevel == ERROR
257 */
258 public void error(Throwable e);
259
260 /***
261 * This is a log metod with logLevel == ERROR
262 */
263 public void error(String message, RunData data);
264
265 /***
266 * This is a log metod with logLevel == ERROR
267 */
268 public void error(String message, RunData data, Throwable e);
269 }
This page was automatically generated by Maven