/lib/apache-log4j/site/apidocs/org/apache/log4j/BasicConfigurator.html

https://bitbucket.org/arkban/somersault · HTML · 319 lines · 260 code · 37 blank · 22 comment · 0 complexity · 872dffa84ca8322a166a9d895237b0e8 MD5 · raw file

  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  2. <!--NewPage-->
  3. <HTML>
  4. <HEAD>
  5. <!-- Generated by javadoc (build 1.6.0_16) -->
  6. <META http-equiv="Content-Type" content="text/html; charset=UTF-8">
  7. <TITLE>
  8. BasicConfigurator (Apache Log4j 1.2.16 API)
  9. </TITLE>
  10. <META NAME="date" CONTENT="2010-03-30">
  11. <LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style">
  12. <SCRIPT type="text/javascript">
  13. function windowTitle()
  14. {
  15. if (location.href.indexOf('is-external=true') == -1) {
  16. parent.document.title="BasicConfigurator (Apache Log4j 1.2.16 API)";
  17. }
  18. }
  19. </SCRIPT>
  20. <NOSCRIPT>
  21. </NOSCRIPT>
  22. </HEAD>
  23. <BODY BGCOLOR="white" onload="windowTitle();">
  24. <HR>
  25. <!-- ========= START OF TOP NAVBAR ======= -->
  26. <A NAME="navbar_top"><!-- --></A>
  27. <A HREF="#skip-navbar_top" title="Skip navigation links"></A>
  28. <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
  29. <TR>
  30. <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
  31. <A NAME="navbar_top_firstrow"><!-- --></A>
  32. <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
  33. <TR ALIGN="center" VALIGN="top">
  34. <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
  35. <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
  36. <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
  37. <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/BasicConfigurator.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
  38. <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
  39. <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
  40. <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
  41. <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
  42. </TR>
  43. </TABLE>
  44. </TD>
  45. <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
  46. </EM>
  47. </TD>
  48. </TR>
  49. <TR>
  50. <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
  51. &nbsp;<A HREF="../../../org/apache/log4j/AsyncAppender.html" title="class in org.apache.log4j"><B>PREV CLASS</B></A>&nbsp;
  52. &nbsp;<A HREF="../../../org/apache/log4j/Category.html" title="class in org.apache.log4j"><B>NEXT CLASS</B></A></FONT></TD>
  53. <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
  54. <A HREF="../../../index.html?org/apache/log4j/BasicConfigurator.html" target="_top"><B>FRAMES</B></A> &nbsp;
  55. &nbsp;<A HREF="BasicConfigurator.html" target="_top"><B>NO FRAMES</B></A> &nbsp;
  56. &nbsp;<SCRIPT type="text/javascript">
  57. <!--
  58. if(window==top) {
  59. document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>');
  60. }
  61. //-->
  62. </SCRIPT>
  63. <NOSCRIPT>
  64. <A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>
  65. </NOSCRIPT>
  66. </FONT></TD>
  67. </TR>
  68. <TR>
  69. <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
  70. SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
  71. <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
  72. DETAIL:&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
  73. </TR>
  74. </TABLE>
  75. <A NAME="skip-navbar_top"></A>
  76. <!-- ========= END OF TOP NAVBAR ========= -->
  77. <HR>
  78. <!-- ======== START OF CLASS DATA ======== -->
  79. <H2>
  80. <FONT SIZE="-1">
  81. org.apache.log4j</FONT>
  82. <BR>
  83. Class BasicConfigurator</H2>
  84. <PRE>
  85. <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">java.lang.Object</A>
  86. <IMG SRC="../../../resources/inherit.gif" ALT="extended by "><B>org.apache.log4j.BasicConfigurator</B>
  87. </PRE>
  88. <HR>
  89. <DL>
  90. <DT><PRE>public class <B>BasicConfigurator</B><DT>extends <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A></DL>
  91. </PRE>
  92. <P>
  93. Use this class to quickly configure the package.
  94. <p>For file based configuration see <A HREF="../../../org/apache/log4j/PropertyConfigurator.html" title="class in org.apache.log4j"><CODE>PropertyConfigurator</CODE></A>. For XML based configuration see <A HREF="../../../org/apache/log4j/xml/DOMConfigurator.html" title="class in org.apache.log4j.xml"><CODE>DOMConfigurator</CODE></A>.
  95. <P>
  96. <P>
  97. <DL>
  98. <DT><B>Since:</B></DT>
  99. <DD>0.8.1</DD>
  100. <DT><B>Author:</B></DT>
  101. <DD>Ceki G&uuml;lc&uuml;</DD>
  102. </DL>
  103. <HR>
  104. <P>
  105. <!-- ======== CONSTRUCTOR SUMMARY ======== -->
  106. <A NAME="constructor_summary"><!-- --></A>
  107. <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
  108. <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
  109. <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
  110. <B>Constructor Summary</B></FONT></TH>
  111. </TR>
  112. <TR BGCOLOR="white" CLASS="TableRowColor">
  113. <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
  114. <CODE>protected </CODE></FONT></TD>
  115. <TD><CODE><B><A HREF="../../../org/apache/log4j/BasicConfigurator.html#BasicConfigurator()">BasicConfigurator</A></B>()</CODE>
  116. <BR>
  117. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
  118. </TR>
  119. </TABLE>
  120. &nbsp;
  121. <!-- ========== METHOD SUMMARY =========== -->
  122. <A NAME="method_summary"><!-- --></A>
  123. <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
  124. <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
  125. <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
  126. <B>Method Summary</B></FONT></TH>
  127. </TR>
  128. <TR BGCOLOR="white" CLASS="TableRowColor">
  129. <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
  130. <CODE>static&nbsp;void</CODE></FONT></TD>
  131. <TD><CODE><B><A HREF="../../../org/apache/log4j/BasicConfigurator.html#configure()">configure</A></B>()</CODE>
  132. <BR>
  133. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Add a <A HREF="../../../org/apache/log4j/ConsoleAppender.html" title="class in org.apache.log4j"><CODE>ConsoleAppender</CODE></A> that uses <A HREF="../../../org/apache/log4j/PatternLayout.html" title="class in org.apache.log4j"><CODE>PatternLayout</CODE></A>
  134. using the <A HREF="../../../org/apache/log4j/PatternLayout.html#TTCC_CONVERSION_PATTERN"><CODE>PatternLayout.TTCC_CONVERSION_PATTERN</CODE></A> and
  135. prints to <code>System.out</code> to the root category.</TD>
  136. </TR>
  137. <TR BGCOLOR="white" CLASS="TableRowColor">
  138. <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
  139. <CODE>static&nbsp;void</CODE></FONT></TD>
  140. <TD><CODE><B><A HREF="../../../org/apache/log4j/BasicConfigurator.html#configure(org.apache.log4j.Appender)">configure</A></B>(<A HREF="../../../org/apache/log4j/Appender.html" title="interface in org.apache.log4j">Appender</A>&nbsp;appender)</CODE>
  141. <BR>
  142. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Add <code>appender</code> to the root category.</TD>
  143. </TR>
  144. <TR BGCOLOR="white" CLASS="TableRowColor">
  145. <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
  146. <CODE>static&nbsp;void</CODE></FONT></TD>
  147. <TD><CODE><B><A HREF="../../../org/apache/log4j/BasicConfigurator.html#resetConfiguration()">resetConfiguration</A></B>()</CODE>
  148. <BR>
  149. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Reset the default hierarchy to its defaut.</TD>
  150. </TR>
  151. </TABLE>
  152. &nbsp;<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A>
  153. <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
  154. <TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
  155. <TH ALIGN="left"><B>Methods inherited from class java.lang.<A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A></B></TH>
  156. </TR>
  157. <TR BGCOLOR="white" CLASS="TableRowColor">
  158. <TD><CODE><A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html?is-external=true#clone()" title="class or interface in java.lang">clone</A>, <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html?is-external=true#equals(java.lang.Object)" title="class or interface in java.lang">equals</A>, <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html?is-external=true#finalize()" title="class or interface in java.lang">finalize</A>, <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html?is-external=true#getClass()" title="class or interface in java.lang">getClass</A>, <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html?is-external=true#hashCode()" title="class or interface in java.lang">hashCode</A>, <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html?is-external=true#notify()" title="class or interface in java.lang">notify</A>, <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html?is-external=true#notifyAll()" title="class or interface in java.lang">notifyAll</A>, <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html?is-external=true#toString()" title="class or interface in java.lang">toString</A>, <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html?is-external=true#wait()" title="class or interface in java.lang">wait</A>, <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html?is-external=true#wait(long)" title="class or interface in java.lang">wait</A>, <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html?is-external=true#wait(long, int)" title="class or interface in java.lang">wait</A></CODE></TD>
  159. </TR>
  160. </TABLE>
  161. &nbsp;
  162. <P>
  163. <!-- ========= CONSTRUCTOR DETAIL ======== -->
  164. <A NAME="constructor_detail"><!-- --></A>
  165. <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
  166. <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
  167. <TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
  168. <B>Constructor Detail</B></FONT></TH>
  169. </TR>
  170. </TABLE>
  171. <A NAME="BasicConfigurator()"><!-- --></A><H3>
  172. BasicConfigurator</H3>
  173. <PRE>
  174. protected <B>BasicConfigurator</B>()</PRE>
  175. <DL>
  176. </DL>
  177. <!-- ============ METHOD DETAIL ========== -->
  178. <A NAME="method_detail"><!-- --></A>
  179. <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
  180. <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
  181. <TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
  182. <B>Method Detail</B></FONT></TH>
  183. </TR>
  184. </TABLE>
  185. <A NAME="configure()"><!-- --></A><H3>
  186. configure</H3>
  187. <PRE>
  188. public static void <B>configure</B>()</PRE>
  189. <DL>
  190. <DD>Add a <A HREF="../../../org/apache/log4j/ConsoleAppender.html" title="class in org.apache.log4j"><CODE>ConsoleAppender</CODE></A> that uses <A HREF="../../../org/apache/log4j/PatternLayout.html" title="class in org.apache.log4j"><CODE>PatternLayout</CODE></A>
  191. using the <A HREF="../../../org/apache/log4j/PatternLayout.html#TTCC_CONVERSION_PATTERN"><CODE>PatternLayout.TTCC_CONVERSION_PATTERN</CODE></A> and
  192. prints to <code>System.out</code> to the root category.
  193. <P>
  194. <DD><DL>
  195. </DL>
  196. </DD>
  197. </DL>
  198. <HR>
  199. <A NAME="configure(org.apache.log4j.Appender)"><!-- --></A><H3>
  200. configure</H3>
  201. <PRE>
  202. public static void <B>configure</B>(<A HREF="../../../org/apache/log4j/Appender.html" title="interface in org.apache.log4j">Appender</A>&nbsp;appender)</PRE>
  203. <DL>
  204. <DD>Add <code>appender</code> to the root category.
  205. <P>
  206. <DD><DL>
  207. <DT><B>Parameters:</B><DD><CODE>appender</CODE> - The appender to add to the root category.</DL>
  208. </DD>
  209. </DL>
  210. <HR>
  211. <A NAME="resetConfiguration()"><!-- --></A><H3>
  212. resetConfiguration</H3>
  213. <PRE>
  214. public static void <B>resetConfiguration</B>()</PRE>
  215. <DL>
  216. <DD>Reset the default hierarchy to its defaut. It is equivalent to
  217. calling
  218. <code>Category.getDefaultHierarchy().resetConfiguration()</code>.
  219. See <A HREF="../../../org/apache/log4j/Hierarchy.html#resetConfiguration()"><CODE>Hierarchy.resetConfiguration()</CODE></A> for more details.
  220. <P>
  221. <DD><DL>
  222. </DL>
  223. </DD>
  224. </DL>
  225. <!-- ========= END OF CLASS DATA ========= -->
  226. <HR>
  227. <!-- ======= START OF BOTTOM NAVBAR ====== -->
  228. <A NAME="navbar_bottom"><!-- --></A>
  229. <A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
  230. <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
  231. <TR>
  232. <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
  233. <A NAME="navbar_bottom_firstrow"><!-- --></A>
  234. <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
  235. <TR ALIGN="center" VALIGN="top">
  236. <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
  237. <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
  238. <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
  239. <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/BasicConfigurator.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
  240. <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
  241. <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
  242. <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
  243. <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
  244. </TR>
  245. </TABLE>
  246. </TD>
  247. <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
  248. </EM>
  249. </TD>
  250. </TR>
  251. <TR>
  252. <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
  253. &nbsp;<A HREF="../../../org/apache/log4j/AsyncAppender.html" title="class in org.apache.log4j"><B>PREV CLASS</B></A>&nbsp;
  254. &nbsp;<A HREF="../../../org/apache/log4j/Category.html" title="class in org.apache.log4j"><B>NEXT CLASS</B></A></FONT></TD>
  255. <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
  256. <A HREF="../../../index.html?org/apache/log4j/BasicConfigurator.html" target="_top"><B>FRAMES</B></A> &nbsp;
  257. &nbsp;<A HREF="BasicConfigurator.html" target="_top"><B>NO FRAMES</B></A> &nbsp;
  258. &nbsp;<SCRIPT type="text/javascript">
  259. <!--
  260. if(window==top) {
  261. document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>');
  262. }
  263. //-->
  264. </SCRIPT>
  265. <NOSCRIPT>
  266. <A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>
  267. </NOSCRIPT>
  268. </FONT></TD>
  269. </TR>
  270. <TR>
  271. <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
  272. SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
  273. <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
  274. DETAIL:&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
  275. </TR>
  276. </TABLE>
  277. <A NAME="skip-navbar_bottom"></A>
  278. <!-- ======== END OF BOTTOM NAVBAR ======= -->
  279. <HR>
  280. Copyright &#169; 1999-2010 <a href="http://www.apache.org">Apache Software Foundation</a>. All Rights Reserved.
  281. </BODY>
  282. </HTML>