1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc (build 1.6.0) on Sat Aug 25 00:26:56 EDT 2007 -->
<META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<TITLE>
PropertyConfigurator (Apache Log4j 1.2.15 API)
</TITLE>
<META NAME="date" CONTENT="2007-08-25">
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style">
<SCRIPT type="text/javascript">
function windowTitle()
{
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="PropertyConfigurator (Apache Log4j 1.2.15 API)";
}
}
</SCRIPT>
<NOSCRIPT>
</NOSCRIPT>
</HEAD>
<BODY BGCOLOR="white" onload="windowTitle();">
<HR>
<!-- ========= START OF TOP NAVBAR ======= -->
<A NAME="navbar_top"><!-- --></A>
<A HREF="#skip-navbar_top" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_top_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/PropertyConfigurator.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../org/apache/log4j/Priority.html" title="class in org.apache.log4j"><B>PREV CLASS</B></A>
<A HREF="../../../org/apache/log4j/RollingFileAppender.html" title="class in org.apache.log4j"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../index.html?org/apache/log4j/PropertyConfigurator.html" target="_top"><B>FRAMES</B></A>
<A HREF="PropertyConfigurator.html" target="_top"><B>NO FRAMES</B></A>
<SCRIPT type="text/javascript">
<!--
if(window==top) {
document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>');
}
//-->
</SCRIPT>
<NOSCRIPT>
<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
SUMMARY: NESTED | <A HREF="#field_summary">FIELD</A> | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL: <A HREF="#field_detail">FIELD</A> | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_top"></A>
<!-- ========= END OF TOP NAVBAR ========= -->
<HR>
<!-- ======== START OF CLASS DATA ======== -->
<H2>
<FONT SIZE="-1">
org.apache.log4j</FONT>
<BR>
Class PropertyConfigurator</H2>
<PRE>
java.lang.Object
<IMG SRC="../../../resources/inherit.gif" ALT="extended by "><B>org.apache.log4j.PropertyConfigurator</B>
</PRE>
<DL>
<DT><B>All Implemented Interfaces:</B> <DD><A HREF="../../../org/apache/log4j/spi/Configurator.html" title="interface in org.apache.log4j.spi">Configurator</A></DD>
</DL>
<HR>
<DL>
<DT><PRE>public class <B>PropertyConfigurator</B><DT>extends java.lang.Object<DT>implements <A HREF="../../../org/apache/log4j/spi/Configurator.html" title="interface in org.apache.log4j.spi">Configurator</A></DL>
</PRE>
<P>
Allows the configuration of log4j from an external file. See
<b><A HREF="../../../org/apache/log4j/PropertyConfigurator.html#doConfigure(java.lang.String, org.apache.log4j.spi.LoggerRepository)"><CODE>doConfigure(String, LoggerRepository)</CODE></A></b> for the
expected format.
<p>It is sometimes useful to see how log4j is reading configuration
files. You can enable log4j internal logging by defining the
<b>log4j.debug</b> variable.
<P>As of log4j version 0.8.5, at class initialization time class,
the file <b>log4j.properties</b> will be searched from the search
path used to load classes. If the file can be found, then it will
be fed to the <A HREF="../../../org/apache/log4j/PropertyConfigurator.html#configure(java.net.URL)"><CODE>configure(java.net.URL)</CODE></A>
method.
<p>The <code>PropertyConfigurator</code> does not handle the
advanced configuration features supported by the <A HREF="../../../org/apache/log4j/xml/DOMConfigurator.html" title="class in org.apache.log4j.xml"><CODE>DOMConfigurator</CODE></A> such as
support for <A HREF="../../../org/apache/log4j/spi/Filter.html" title="class in org.apache.log4j.spi"><CODE>Filters</CODE></A>, custom
<A HREF="../../../org/apache/log4j/spi/ErrorHandler.html" title="interface in org.apache.log4j.spi"><CODE>ErrorHandlers</CODE></A>, nested
appenders such as the <A HREF="../../../org/apache/log4j/AsyncAppender.html" title="class in org.apache.log4j"><CODE>AsyncAppender</CODE></A>, etc.
<p>All option <em>values</em> admit variable substitution. The
syntax of variable substitution is similar to that of Unix
shells. The string between an opening <b>"${"</b> and
closing <b>"}"</b> is interpreted as a key. The value of
the substituted variable can be defined as a system property or in
the configuration file itself. The value of the key is first
searched in the system properties, and if not found there, it is
then searched in the configuration file being parsed. The
corresponding value replaces the ${variableName} sequence. For
example, if <code>java.home</code> system property is set to
<code>/home/xyz</code>, then every occurrence of the sequence
<code>${java.home}</code> will be interpreted as
<code>/home/xyz</code>.
<P>
<P>
<DL>
<DT><B>Since:</B></DT>
<DD>0.8.1</DD>
<DT><B>Author:</B></DT>
<DD>Ceki Gülcü, Anders Kristensen</DD>
</DL>
<HR>
<P>
<!-- =========== FIELD SUMMARY =========== -->
<A NAME="field_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Field Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static java.lang.String</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../org/apache/log4j/PropertyConfigurator.html#LOGGER_FACTORY_KEY">LOGGER_FACTORY_KEY</A></B></CODE>
<BR>
Key for specifying the <A HREF="../../../org/apache/log4j/spi/LoggerFactory.html" title="interface in org.apache.log4j.spi"><CODE>LoggerFactory</CODE></A>.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>protected <A HREF="../../../org/apache/log4j/spi/LoggerFactory.html" title="interface in org.apache.log4j.spi">LoggerFactory</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../org/apache/log4j/PropertyConfigurator.html#loggerFactory">loggerFactory</A></B></CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>protected java.util.Hashtable</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../org/apache/log4j/PropertyConfigurator.html#registry">registry</A></B></CODE>
<BR>
Used internally to keep track of configured appenders.</TD>
</TR>
</TABLE>
<A NAME="fields_inherited_from_class_org.apache.log4j.spi.Configurator"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
<TH ALIGN="left"><B>Fields inherited from interface org.apache.log4j.spi.<A HREF="../../../org/apache/log4j/spi/Configurator.html" title="interface in org.apache.log4j.spi">Configurator</A></B></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><A HREF="../../../org/apache/log4j/spi/Configurator.html#INHERITED">INHERITED</A>, <A HREF="../../../org/apache/log4j/spi/Configurator.html#NULL">NULL</A></CODE></TD>
</TR>
</TABLE>
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<A NAME="constructor_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Constructor Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><B><A HREF="../../../org/apache/log4j/PropertyConfigurator.html#PropertyConfigurator()">PropertyConfigurator</A></B>()</CODE>
<BR>
</TD>
</TR>
</TABLE>
<!-- ========== METHOD SUMMARY =========== -->
<A NAME="method_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Method Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../org/apache/log4j/PropertyConfigurator.html#configure(java.util.Properties)">configure</A></B>(java.util.Properties properties)</CODE>
<BR>
Read configuration options from <code>properties</code>.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../org/apache/log4j/PropertyConfigurator.html#configure(java.lang.String)">configure</A></B>(java.lang.String configFilename)</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../org/apache/log4j/PropertyConfigurator.html#configure(java.net.URL)">configure</A></B>(java.net.URL configURL)</CODE>
<BR>
Read configuration options from url <code>configURL</code>.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../org/apache/log4j/PropertyConfigurator.html#configureAndWatch(java.lang.String)">configureAndWatch</A></B>(java.lang.String configFilename)</CODE>
<BR>
Like <A HREF="../../../org/apache/log4j/PropertyConfigurator.html#configureAndWatch(java.lang.String, long)"><CODE>configureAndWatch(String, long)</CODE></A> except that the
default delay as defined by <A HREF="../../../org/apache/log4j/helpers/FileWatchdog.html#DEFAULT_DELAY"><CODE>FileWatchdog.DEFAULT_DELAY</CODE></A> is
used.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../org/apache/log4j/PropertyConfigurator.html#configureAndWatch(java.lang.String, long)">configureAndWatch</A></B>(java.lang.String configFilename,
long delay)</CODE>
<BR>
Read the configuration file <code>configFilename</code> if it
exists.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>protected void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../org/apache/log4j/PropertyConfigurator.html#configureLoggerFactory(java.util.Properties)">configureLoggerFactory</A></B>(java.util.Properties props)</CODE>
<BR>
Check the provided <code>Properties</code> object for a
<A HREF="../../../org/apache/log4j/spi/LoggerFactory.html" title="interface in org.apache.log4j.spi"><CODE>LoggerFactory</CODE></A>
entry specified by <A HREF="../../../org/apache/log4j/PropertyConfigurator.html#LOGGER_FACTORY_KEY"><CODE>LOGGER_FACTORY_KEY</CODE></A>.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../org/apache/log4j/PropertyConfigurator.html#doConfigure(java.util.Properties, org.apache.log4j.spi.LoggerRepository)">doConfigure</A></B>(java.util.Properties properties,
<A HREF="../../../org/apache/log4j/spi/LoggerRepository.html" title="interface in org.apache.log4j.spi">LoggerRepository</A> hierarchy)</CODE>
<BR>
Read configuration options from <code>properties</code>.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../org/apache/log4j/PropertyConfigurator.html#doConfigure(java.lang.String, org.apache.log4j.spi.LoggerRepository)">doConfigure</A></B>(java.lang.String configFileName,
<A HREF="../../../org/apache/log4j/spi/LoggerRepository.html" title="interface in org.apache.log4j.spi">LoggerRepository</A> hierarchy)</CODE>
<BR>
Read configuration from a file.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../org/apache/log4j/PropertyConfigurator.html#doConfigure(java.net.URL, org.apache.log4j.spi.LoggerRepository)">doConfigure</A></B>(java.net.URL configURL,
<A HREF="../../../org/apache/log4j/spi/LoggerRepository.html" title="interface in org.apache.log4j.spi">LoggerRepository</A> hierarchy)</CODE>
<BR>
Read configuration options from url <code>configURL</code>.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>protected void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../org/apache/log4j/PropertyConfigurator.html#parseCatsAndRenderers(java.util.Properties, org.apache.log4j.spi.LoggerRepository)">parseCatsAndRenderers</A></B>(java.util.Properties props,
<A HREF="../../../org/apache/log4j/spi/LoggerRepository.html" title="interface in org.apache.log4j.spi">LoggerRepository</A> hierarchy)</CODE>
<BR>
Parse non-root elements, such non-root categories and renderers.</TD>
</TR>
</TABLE>
<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
<TH ALIGN="left"><B>Methods inherited from class java.lang.Object</B></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</CODE></TD>
</TR>
</TABLE>
<P>
<!-- ============ FIELD DETAIL =========== -->
<A NAME="field_detail"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
<B>Field Detail</B></FONT></TH>
</TR>
</TABLE>
<A NAME="registry"><!-- --></A><H3>
registry</H3>
<PRE>
protected java.util.Hashtable <B>registry</B></PRE>
<DL>
<DD>Used internally to keep track of configured appenders.
<P>
<DL>
</DL>
</DL>
<HR>
<A NAME="loggerFactory"><!-- --></A><H3>
loggerFactory</H3>
<PRE>
protected <A HREF="../../../org/apache/log4j/spi/LoggerFactory.html" title="interface in org.apache.log4j.spi">LoggerFactory</A> <B>loggerFactory</B></PRE>
<DL>
<DL>
</DL>
</DL>
<HR>
<A NAME="LOGGER_FACTORY_KEY"><!-- --></A><H3>
LOGGER_FACTORY_KEY</H3>
<PRE>
public static final java.lang.String <B>LOGGER_FACTORY_KEY</B></PRE>
<DL>
<DD>Key for specifying the <A HREF="../../../org/apache/log4j/spi/LoggerFactory.html" title="interface in org.apache.log4j.spi"><CODE>LoggerFactory</CODE></A>. Currently set to "<code>log4j.loggerFactory</code>".
<P>
<DL>
<DT><B>See Also:</B><DD><A HREF="../../../constant-values.html#org.apache.log4j.PropertyConfigurator.LOGGER_FACTORY_KEY">Constant Field Values</A></DL>
</DL>
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<A NAME="constructor_detail"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
<B>Constructor Detail</B></FONT></TH>
</TR>
</TABLE>
<A NAME="PropertyConfigurator()"><!-- --></A><H3>
PropertyConfigurator</H3>
<PRE>
public <B>PropertyConfigurator</B>()</PRE>
<DL>
</DL>
<!-- ============ METHOD DETAIL ========== -->
<A NAME="method_detail"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
<B>Method Detail</B></FONT></TH>
</TR>
</TABLE>
<A NAME="doConfigure(java.lang.String, org.apache.log4j.spi.LoggerRepository)"><!-- --></A><H3>
doConfigure</H3>
<PRE>
public void <B>doConfigure</B>(java.lang.String configFileName,
<A HREF="../../../org/apache/log4j/spi/LoggerRepository.html" title="interface in org.apache.log4j.spi">LoggerRepository</A> hierarchy)</PRE>
<DL>
<DD>Read configuration from a file. <b>The existing configuration is
not cleared nor reset.</b> If you require a different behavior,
then call <A HREF="../../../org/apache/log4j/LogManager.html#resetConfiguration()"><CODE>resetConfiguration</CODE></A> method before calling
<code>doConfigure</code>.
<p>The configuration file consists of statements in the format
<code>key=value</code>. The syntax of different configuration
elements are discussed below.
<h3>Repository-wide threshold</h3>
<p>The repository-wide threshold filters logging requests by level
regardless of logger. The syntax is:
<pre>
log4j.threshold=[level]
</pre>
<p>The level value can consist of the string values OFF, FATAL,
ERROR, WARN, INFO, DEBUG, ALL or a <em>custom level</em> value. A
custom level value can be specified in the form
level#classname. By default the repository-wide threshold is set
to the lowest possible value, namely the level <code>ALL</code>.
</p>
<h3>Appender configuration</h3>
<p>Appender configuration syntax is:
<pre>
# For appender named <i>appenderName</i>, set its class.
# Note: The appender name can contain dots.
log4j.appender.appenderName=fully.qualified.name.of.appender.class
# Set appender specific options.
log4j.appender.appenderName.option1=value1
...
log4j.appender.appenderName.optionN=valueN
</pre>
For each named appender you can configure its <A HREF="../../../org/apache/log4j/Layout.html" title="class in org.apache.log4j"><CODE>Layout</CODE></A>. The
syntax for configuring an appender's layout is:
<pre>
log4j.appender.appenderName.layout=fully.qualified.name.of.layout.class
log4j.appender.appenderName.layout.option1=value1
....
log4j.appender.appenderName.layout.optionN=valueN
</pre>
<h3>Configuring loggers</h3>
<p>The syntax for configuring the root logger is:
<pre>
log4j.rootLogger=[level], appenderName, appenderName, ...
</pre>
<p>This syntax means that an optional <em>level</em> can be
supplied followed by appender names separated by commas.
<p>The level value can consist of the string values OFF, FATAL,
ERROR, WARN, INFO, DEBUG, ALL or a <em>custom level</em> value. A
custom level value can be specified in the form
<code>level#classname</code>.
<p>If a level value is specified, then the root level is set
to the corresponding level. If no level value is specified,
then the root level remains untouched.
<p>The root logger can be assigned multiple appenders.
<p>Each <i>appenderName</i> (separated by commas) will be added to
the root logger. The named appender is defined using the
appender syntax defined above.
<p>For non-root categories the syntax is almost the same:
<pre>
log4j.logger.logger_name=[level|INHERITED|NULL], appenderName, appenderName, ...
</pre>
<p>The meaning of the optional level value is discussed above
in relation to the root logger. In addition however, the value
INHERITED can be specified meaning that the named logger should
inherit its level from the logger hierarchy.
<p>If no level value is supplied, then the level of the
named logger remains untouched.
<p>By default categories inherit their level from the
hierarchy. However, if you set the level of a logger and later
decide that that logger should inherit its level, then you should
specify INHERITED as the value for the level value. NULL is a
synonym for INHERITED.
<p>Similar to the root logger syntax, each <i>appenderName</i>
(separated by commas) will be attached to the named logger.
<p>See the <a href="../../../../manual.html#additivity">appender
additivity rule</a> in the user manual for the meaning of the
<code>additivity</code> flag.
<h3>ObjectRenderers</h3>
You can customize the way message objects of a given type are
converted to String before being logged. This is done by
specifying an <A HREF="../../../org/apache/log4j/or/ObjectRenderer.html" title="interface in org.apache.log4j.or"><CODE>ObjectRenderer</CODE></A>
for the object type would like to customize.
<p>The syntax is:
<pre>
log4j.renderer.fully.qualified.name.of.rendered.class=fully.qualified.name.of.rendering.class
</pre>
As in,
<pre>
log4j.renderer.my.Fruit=my.FruitRenderer
</pre>
<h3>Logger Factories</h3>
The usage of custom logger factories is discouraged and no longer
documented.
<h3>Resetting Hierarchy</h3>
The hierarchy will be reset before configuration when
log4j.reset=true is present in the properties file.
<h3>Example</h3>
<p>An example configuration is given below. Other configuration
file examples are given in the <code>examples</code> folder.
<pre>
# Set options for appender named "A1".
# Appender "A1" will be a SyslogAppender
log4j.appender.A1=org.apache.log4j.net.SyslogAppender
# The syslog daemon resides on www.abc.net
log4j.appender.A1.SyslogHost=www.abc.net
# A1's layout is a PatternLayout, using the conversion pattern
# <b>%r %-5p %c{2} %M.%L %x - %m\n</b>. Thus, the log output will
# include # the relative time since the start of the application in
# milliseconds, followed by the level of the log request,
# followed by the two rightmost components of the logger name,
# followed by the callers method name, followed by the line number,
# the nested disgnostic context and finally the message itself.
# Refer to the documentation of <A HREF="../../../org/apache/log4j/PatternLayout.html" title="class in org.apache.log4j"><CODE>PatternLayout</CODE></A> for further information
# on the syntax of the ConversionPattern key.
log4j.appender.A1.layout=org.apache.log4j.PatternLayout
log4j.appender.A1.layout.ConversionPattern=%-4r %-5p %c{2} %M.%L %x - %m\n
# Set options for appender named "A2"
# A2 should be a RollingFileAppender, with maximum file size of 10 MB
# using at most one backup file. A2's layout is TTCC, using the
# ISO8061 date format with context printing enabled.
log4j.appender.A2=org.apache.log4j.RollingFileAppender
log4j.appender.A2.MaxFileSize=10MB
log4j.appender.A2.MaxBackupIndex=1
log4j.appender.A2.layout=org.apache.log4j.TTCCLayout
log4j.appender.A2.layout.ContextPrinting=enabled
log4j.appender.A2.layout.DateFormat=ISO8601
# Root logger set to DEBUG using the A2 appender defined above.
log4j.rootLogger=DEBUG, A2
# Logger definitions:
# The SECURITY logger inherits is level from root. However, it's output
# will go to A1 appender defined above. It's additivity is non-cumulative.
log4j.logger.SECURITY=INHERIT, A1
log4j.additivity.SECURITY=false
# Only warnings or above will be logged for the logger "SECURITY.access".
# Output will go to A1.
log4j.logger.SECURITY.access=WARN
# The logger "class.of.the.day" inherits its level from the
# logger hierarchy. Output will go to the appender's of the root
# logger, A2 in this case.
log4j.logger.class.of.the.day=INHERIT
</pre>
<p>Refer to the <b>setOption</b> method in each Appender and
Layout for class specific options.
<p>Use the <code>#</code> or <code>!</code> characters at the
beginning of a line for comments.
<p>
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>configFileName</CODE> - The name of the configuration file where the
configuration information is stored.</DL>
</DD>
</DL>
<HR>
<A NAME="configure(java.lang.String)"><!-- --></A><H3>
configure</H3>
<PRE>
public static void <B>configure</B>(java.lang.String configFilename)</PRE>
<DL>
<DD><DL>
</DL>
</DD>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="configure(java.net.URL)"><!-- --></A><H3>
configure</H3>
<PRE>
public static void <B>configure</B>(java.net.URL configURL)</PRE>
<DL>
<DD>Read configuration options from url <code>configURL</code>.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Since:</B></DT>
<DD>0.8.2</DD>
</DL>
</DD>
</DL>
<HR>
<A NAME="configure(java.util.Properties)"><!-- --></A><H3>
configure</H3>
<PRE>
public static void <B>configure</B>(java.util.Properties properties)</PRE>
<DL>
<DD>Read configuration options from <code>properties</code>.
See <A HREF="../../../org/apache/log4j/PropertyConfigurator.html#doConfigure(java.lang.String, org.apache.log4j.spi.LoggerRepository)"><CODE>doConfigure(String, LoggerRepository)</CODE></A> for the expected format.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="configureAndWatch(java.lang.String)"><!-- --></A><H3>
configureAndWatch</H3>
<PRE>
public static void <B>configureAndWatch</B>(java.lang.String configFilename)</PRE>
<DL>
<DD>Like <A HREF="../../../org/apache/log4j/PropertyConfigurator.html#configureAndWatch(java.lang.String, long)"><CODE>configureAndWatch(String, long)</CODE></A> except that the
default delay as defined by <A HREF="../../../org/apache/log4j/helpers/FileWatchdog.html#DEFAULT_DELAY"><CODE>FileWatchdog.DEFAULT_DELAY</CODE></A> is
used.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>configFilename</CODE> - A file in key=value format.</DL>
</DD>
</DL>
<HR>
<A NAME="configureAndWatch(java.lang.String, long)"><!-- --></A><H3>
configureAndWatch</H3>
<PRE>
public static void <B>configureAndWatch</B>(java.lang.String configFilename,
long delay)</PRE>
<DL>
<DD>Read the configuration file <code>configFilename</code> if it
exists. Moreover, a thread will be created that will periodically
check if <code>configFilename</code> has been created or
modified. The period is determined by the <code>delay</code>
argument. If a change or file creation is detected, then
<code>configFilename</code> is read to configure log4j.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>configFilename</CODE> - A file in key=value format.<DD><CODE>delay</CODE> - The delay in milliseconds to wait between each check.</DL>
</DD>
</DL>
<HR>
<A NAME="doConfigure(java.util.Properties, org.apache.log4j.spi.LoggerRepository)"><!-- --></A><H3>
doConfigure</H3>
<PRE>
public void <B>doConfigure</B>(java.util.Properties properties,
<A HREF="../../../org/apache/log4j/spi/LoggerRepository.html" title="interface in org.apache.log4j.spi">LoggerRepository</A> hierarchy)</PRE>
<DL>
<DD>Read configuration options from <code>properties</code>.
See <A HREF="../../../org/apache/log4j/PropertyConfigurator.html#doConfigure(java.lang.String, org.apache.log4j.spi.LoggerRepository)"><CODE>doConfigure(String, LoggerRepository)</CODE></A> for the expected format.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="doConfigure(java.net.URL, org.apache.log4j.spi.LoggerRepository)"><!-- --></A><H3>
doConfigure</H3>
<PRE>
public void <B>doConfigure</B>(java.net.URL configURL,
<A HREF="../../../org/apache/log4j/spi/LoggerRepository.html" title="interface in org.apache.log4j.spi">LoggerRepository</A> hierarchy)</PRE>
<DL>
<DD>Read configuration options from url <code>configURL</code>.
<P>
<DD><DL>
<DT><B>Specified by:</B><DD><CODE><A HREF="../../../org/apache/log4j/spi/Configurator.html#doConfigure(java.net.URL, org.apache.log4j.spi.LoggerRepository)">doConfigure</A></CODE> in interface <CODE><A HREF="../../../org/apache/log4j/spi/Configurator.html" title="interface in org.apache.log4j.spi">Configurator</A></CODE></DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>configURL</CODE> - The URL to parse<DD><CODE>hierarchy</CODE> - The hierarchy to operation upon.</DL>
</DD>
</DL>
<HR>
<A NAME="configureLoggerFactory(java.util.Properties)"><!-- --></A><H3>
configureLoggerFactory</H3>
<PRE>
protected void <B>configureLoggerFactory</B>(java.util.Properties props)</PRE>
<DL>
<DD>Check the provided <code>Properties</code> object for a
<A HREF="../../../org/apache/log4j/spi/LoggerFactory.html" title="interface in org.apache.log4j.spi"><CODE>LoggerFactory</CODE></A>
entry specified by <A HREF="../../../org/apache/log4j/PropertyConfigurator.html#LOGGER_FACTORY_KEY"><CODE>LOGGER_FACTORY_KEY</CODE></A>. If such an entry
exists, an attempt is made to create an instance using the default
constructor. This instance is used for subsequent Category creations
within this configurator.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>See Also:</B><DD><A HREF="../../../org/apache/log4j/PropertyConfigurator.html#parseCatsAndRenderers(java.util.Properties, org.apache.log4j.spi.LoggerRepository)"><CODE>parseCatsAndRenderers(java.util.Properties, org.apache.log4j.spi.LoggerRepository)</CODE></A></DL>
</DD>
</DL>
<HR>
<A NAME="parseCatsAndRenderers(java.util.Properties, org.apache.log4j.spi.LoggerRepository)"><!-- --></A><H3>
parseCatsAndRenderers</H3>
<PRE>
protected void <B>parseCatsAndRenderers</B>(java.util.Properties props,
<A HREF="../../../org/apache/log4j/spi/LoggerRepository.html" title="interface in org.apache.log4j.spi">LoggerRepository</A> hierarchy)</PRE>
<DL>
<DD>Parse non-root elements, such non-root categories and renderers.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
</DL>
</DD>
</DL>
<!-- ========= END OF CLASS DATA ========= -->
<HR>
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<A NAME="navbar_bottom"><!-- --></A>
<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_bottom_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/PropertyConfigurator.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../org/apache/log4j/Priority.html" title="class in org.apache.log4j"><B>PREV CLASS</B></A>
<A HREF="../../../org/apache/log4j/RollingFileAppender.html" title="class in org.apache.log4j"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../index.html?org/apache/log4j/PropertyConfigurator.html" target="_top"><B>FRAMES</B></A>
<A HREF="PropertyConfigurator.html" target="_top"><B>NO FRAMES</B></A>
<SCRIPT type="text/javascript">
<!--
if(window==top) {
document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>');
}
//-->
</SCRIPT>
<NOSCRIPT>
<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
SUMMARY: NESTED | <A HREF="#field_summary">FIELD</A> | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL: <A HREF="#field_detail">FIELD</A> | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_bottom"></A>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<HR>
Copyright © 1999-2007 <a href="http://www.apache.org">Apache Software Foundation</a>. All Rights Reserved.
</BODY>
</HTML>
|