KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > sync4j > framework > config > LoggerConfiguration


1 /**
2  * Copyright (C) 2003-2005 Funambol
3  *
4  *This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation; either version 2 of the License, or
7  * (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17  */

18 package sync4j.framework.config;
19
20
21 /**
22  * This class is just a container of logger configuration information.
23  *
24  *
25  * @author Stefano Fornari @ Funambol
26  * @version $Id: LoggerConfiguration.java,v 1.4 2005/03/02 20:57:37 harrie Exp $
27  */

28 public class LoggerConfiguration
29 implements java.io.Serializable JavaDoc {
30     
31     // --------------------------------------------------------------- Constants
32

33     public static final String JavaDoc LEVEL_OFF = "NONE" ;
34     public static final String JavaDoc LEVEL_SEVERE = "ERROR" ;
35     public static final String JavaDoc LEVEL_INFO = "INFO" ;
36     public static final String JavaDoc LEVEL_ALL = "ALL" ;
37     
38     // ------------------------------------------------------------ Private data
39

40     /**
41      * The logger name
42      */

43     private String JavaDoc name;
44     
45     /**
46      * The logging level
47      */

48     private String JavaDoc level;
49     
50     /**
51      * shall the output be written to the console too?
52      */

53     private boolean consoleOutput;
54     
55     /**
56      * shall the output be written to a file too?
57      */

58     private boolean fileOutput;
59     
60     /**
61      * the filename pattern; it follows the FileHandler's pattern conventions.
62      */

63     private String JavaDoc pattern;
64     
65     /**
66      * specifies an approximate maximum amount to write (in bytes) to any one
67      * file. If this is zero, then there is no limit.
68      */

69     private int limit;
70     
71     /**
72      * specifies how many output files to cycle through (defaults to 1).
73      */

74     private int count;
75     
76     /**
77      * specifies whether the FileHandler should append onto any existing files
78      * (defaults to false).
79      */

80     private boolean append;
81     
82     /**
83      * Does this logger inheriths from its parent logger?
84      */

85     private boolean inherit;
86     
87     // ------------------------------------------------------------ Constructors
88

89     /** Creates a new instance of LoggingConfiguration */
90     public LoggerConfiguration() {
91     }
92     
93     // ---------------------------------------------------------- Public methods
94

95     /**
96      * Getter for property level.
97      * @return Value of property level.
98      */

99     public String JavaDoc getLevel() {
100         return level;
101     }
102     
103     /**
104      * Setter for property level.
105      * @param level New value of property level.
106      */

107     public void setLevel(String JavaDoc level) {
108         this.level = level;
109     }
110     
111     /**
112      * Getter for property consoleOutput.
113      * @return Value of property consoleOutput.
114      */

115     public boolean isConsoleOutput() {
116         return consoleOutput;
117     }
118     
119     /**
120      * Setter for property consoleOutput.
121      * @param consoleOutput New value of property consoleOutput.
122      */

123     public void setConsoleOutput(boolean consoleOutput) {
124         this.consoleOutput = consoleOutput;
125     }
126     
127     /**
128      * Getter for property fileOutput.
129      * @return Value of property fileOutput.
130      */

131     public boolean isFileOutput() {
132         return fileOutput;
133     }
134     
135     /**
136      * Setter for property fileOutput.
137      * @param fileOutput New value of property fileOutput.
138      */

139     public void setFileOutput(boolean fileOutput) {
140         this.fileOutput = fileOutput;
141     }
142     
143     /**
144      * Getter for property pattern.
145      * @return Value of property pattern.
146      */

147     public java.lang.String JavaDoc getPattern() {
148         return pattern;
149     }
150     
151     /**
152      * Getter for property limit.
153      * @return Value of property limit.
154      */

155     public int getLimit() {
156         return limit;
157     }
158     
159     /**
160      * Setter for property limit.
161      * @param limit New value of property limit.
162      */

163     public void setLimit(int limit) {
164         this.limit = limit;
165     }
166     
167     /**
168      * Setter for property pattern.
169      * @param pattern New value of property pattern.
170      */

171     public void setPattern(java.lang.String JavaDoc pattern) {
172         this.pattern = pattern;
173     }
174     
175     /**
176      * Getter for property count.
177      * @return Value of property count.
178      */

179     public int getCount() {
180         return count;
181     }
182     
183     /**
184      * Setter for property count.
185      * @param count New value of property count.
186      */

187     public void setCount(int count) {
188         this.count = count;
189     }
190     
191     /**
192      * Getter for property append.
193      * @return Value of property appen.
194      */

195     public boolean isAppend() {
196         return append;
197     }
198     
199     /**
200      * Setter for property append.
201      * @param append New value of property append.
202      */

203     public void setAppend(boolean append) {
204         this.append = append;
205     }
206     
207     /**
208      * Getter for property name.
209      * @return Value of property name.
210      */

211     public String JavaDoc getName() {
212         return name;
213     }
214     
215     /**
216      * Setter for property name.
217      * @param name New value of property name.
218      */

219     public void setName(String JavaDoc name) {
220         this.name = name;
221     }
222     
223     /**
224      * Getter for property inherit.
225      * @return Value of property inherit.
226      */

227     public boolean isInherit() {
228         return inherit;
229     }
230     
231     /**
232      * Setter for property inherit.
233      * @param inherit New value of property inherit.
234      */

235     public void setInherit(boolean inherit) {
236         this.inherit = inherit;
237     }
238     
239 }
240
Popular Tags