|
Log4j 0.9.1 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.log4j.BasicConfigurator
Use this class to quickly configure the package.
For file based configuration see PropertyConfigurator
. For XML based configuration see DOMConfigurator
.
Field Summary | |
static String |
DISABLE_OVERRIDE_KEY
Setting the system property log4j.disableOverride to "true" or any other value than "false" overrides the effects of all methods disable(org.log4j.Priority) , disableAll() , disableDebug() and disableInfo() . |
static String |
INHERITED
Special priority value signifying inherited behaviour. |
Constructor Summary | |
protected |
BasicConfigurator()
|
Method Summary | |
static void |
configure()
Add a FileAppender that uses PatternLayout using
the PatternLayout.TTCC_CONVERSION_PATTERN and prints to
System.out to the root category. |
static void |
configure(Appender appender)
Add appender to the root category. |
static void |
disable(Priority p)
Disable all logging requests of priority equal to or below the priority parameter p , regardless of
the request category. |
static void |
disableAll()
Disable all logging requests regardless of category and priority. |
static void |
disableDebug()
Disable all logging requests of priority DEBUG regardless of category. |
static void |
disableInfo()
Disable all logging requests of priority INFO and below regardless of category. |
static void |
enableAll()
Undoes the effect of calling any of disable(org.log4j.Priority) , disableAll() , disableDebug() and disableInfo()
methods. |
static void |
flagAsShippedCode()
Deprecated. |
protected static void |
overrideAsNeeded(String override)
Override the shipped code flag if the override
parameter is not null. |
static void |
resetConfiguration()
Reset the configuration to its default. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final String DISABLE_OVERRIDE_KEY
disable(org.log4j.Priority)
, disableAll()
, disableDebug()
and disableInfo()
. Thus, enabling normal
evaluation of logging requests, i.e. according to the Basic Selection Rule.
DISABLE_OVERRIDE_KEY
is the name of the constant
holding the string value log4j.disableOverride.
public static final String INHERITED
Constructor Detail |
protected BasicConfigurator()
Method Detail |
public static void configure()
FileAppender
that uses PatternLayout
using
the PatternLayout.TTCC_CONVERSION_PATTERN
and prints to
System.out
to the root category.public static void configure(Appender appender)
appender
to the root category.appender
- The appender to add to the root category.public static void disable(Priority p)
p
, regardless of
the request category. Logging requests of higher priority then
the priority of p
remain unaffected.
Nevertheless, if the DISABLE_OVERRIDE_KEY
system
property is set to "true" or any value other than "false", then
logging requests are evaluated as usual, i.e. according to the Basic Selection Rule.
The "disable" family of methods are there for speed. They allow printing methods such as debug, info, etc. to return immediately after an interger comparison without walking the category hierarchy. In most modern computers an integer comparison is measured in nanoseconds where as a category walk is measured in units of microseconds.
Other configurators define alternate ways of overriding the
disable override flag. See PropertyConfigurator
and
DOMConfigurator
.
public static void disableAll()
disable(org.log4j.Priority)
with the
argument Priority.EMERG
, the highest possible priority.public static void disableDebug()
disable(org.log4j.Priority)
with the argument Priority.DEBUG
.public static void disableInfo()
Invoking this method is equivalent to calling disable(org.log4j.Priority)
with the argument Priority.INFO
.
public static void enableAll()
disable(org.log4j.Priority)
, disableAll()
, disableDebug()
and disableInfo()
methods. More precisely, invoking this method sets the Category
class internal variable called disable
to its
default "off" value.public static void flagAsShippedCode()
disableInfo()
method.protected static void overrideAsNeeded(String override)
override
parameter is not null.
If override
is null then there is nothing to do.
Otherwise, set Category.shippedCode to false if override has a
value other than "false".
public static void resetConfiguration()
null
, their additivity flad to
true
and sets the priority of the root category to
DEBUG
. Moreover, message disabling is set
its default "off" value.
This method should be used sparingly and with care as it will block all logging until it is completed.
|
Log4j 0.9.1 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |