|
WebLogic Integration | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.apache.log4j.Category | +--com.bea.logging.LogCategory
Class LogCategory is the Logging Framework's base Class for logging. It extends the Category class of the underlying implementation. It implements two interfaces: ILogger is the public interface to the logging facility. It is returned by the LogManager (c_categoryFactory) to clients wishing to log messages. The INestedDiagnosticContext interface simply exposes the methods of the underlying NDC class, without modifying their behavior.
Inner Class Summary | |
static class |
LogCategory.LogCategoryFactory
|
Field Summary | |
static LogCategory.LogCategoryFactory |
c_categoryFactory
|
Fields inherited from class org.apache.log4j.Category |
additive,
DEFAULT_CONFIGURATION_FILE,
DEFAULT_CONFIGURATION_KEY,
DEFAULT_INIT_OVERRIDE_KEY,
defaultHierarchy,
hierarchy,
name,
parent,
priority,
resourceBundle |
Constructor Summary | |
LogCategory(java.lang.String strContext)
Create a new logging category |
Method Summary | |
void |
addRuntimeDestination(java.io.PrintWriter writer)
Add a new destination at runtime. |
void |
audit(java.lang.String strKey)
Log a message with the audit priority using the strKey for message lookup. |
void |
audit(java.lang.String message,
boolean isDirect)
Log a message with the audit priority. |
void |
audit(java.lang.String strKey,
java.lang.Object obj)
Convenience method which allows the useer to log an audit message with one argument to fill into the template. |
void |
audit(java.lang.String strKey,
java.lang.Object[] aInfo)
Log a message with the audit priority. |
void |
audit(java.lang.Throwable exception)
Log a message with the audit priority. |
void |
clearNDC()
Clear any nested disgnostic information. |
java.util.Stack |
cloneNDCStack()
Clone the diagnostic context for the current thread. |
void |
debug(java.lang.String strMessage)
Log a message with the debug priority. |
static void |
dumpCategories()
This method will print the configuration for all Categories in the current default hierarchy. |
void |
error(java.lang.String strKey)
Log a message with the error priority. |
void |
error(java.lang.String message,
boolean isDirect)
Log a message with the error priority. |
void |
error(java.lang.String strKey,
java.lang.Object obj)
Convenience method which allows the user to log an error message with one argument to fill into the template. |
void |
error(java.lang.String strKey,
java.lang.Object[] aInfo)
Log a message with the error priority. |
void |
error(java.lang.Throwable exception)
Log a message with the error priority. |
protected java.lang.String |
formatMessage(java.lang.String strTemplateKey,
java.lang.Object[] aObj)
formatMessage is used to format a pattern with arguments passed in a Object[] |
static LogCategory |
getCategory(org.apache.log4j.Hierarchy hierarchy,
LogContext context,
java.util.ResourceBundle bundle)
This method is called by the LogManager to create an LogCategory instance. |
protected java.lang.String |
getCategoryInfo(org.apache.log4j.Category c)
|
java.lang.String |
getI18NMessage(java.lang.String strKey)
getI18NMessage(String) can be called to retrieve an Internationalized message string from a resource bundle. |
java.lang.String |
getI18NMessage(java.lang.String strKey,
java.lang.Object obj)
Another convenience method, which allows the user to pass a single argument for replacement in the message template, without having to create an Object[] |
java.lang.String |
getI18NMessage(java.lang.String strKey,
java.lang.Object[] aInfo)
getI18NMessage(String, Object[]) can be called to retrieve an Internationalized message string from a resource bundle. |
static org.apache.log4j.Category |
getInstance(java.lang.String name)
Overrides parent getInstance() using our own c_categoryFactory instance. |
java.io.PrintWriter |
getLogWriter()
|
java.lang.String |
getNDC()
Used when printing the diagnostic context. |
int |
getNDCDepth()
Get the current nesting depth of this diagnostic context |
INestedDiagnosticContext |
getNDCInterface()
Method returns an interface to the static NDC methods that this object can access. |
void |
info(java.lang.String strKey)
Log a message with the info priority. |
void |
info(java.lang.String message,
boolean isDirect)
Log a message with the INFO priority. |
void |
info(java.lang.String strKey,
java.lang.Object obj)
Convenience method which allows the user to log a warn message with one argument to fill into the template. |
void |
info(java.lang.String strKey,
java.lang.Object[] aInfo)
Log a message with the warn priority. |
void |
inheritNDC(java.util.Stack stack)
Inherit the diagnostic context of another thread. |
void |
popNDC()
Clients should call this method before leaving a diagnostic context. |
void |
pushNDC(java.lang.String message)
Push new diagnostic context information for the current thread. |
void |
removeNDC()
Remove the diagnostic context for this thread |
void |
setNDCMaxDepth(int depth)
Set maximum depth of this diagnostic context. |
void |
setPriority(int intPriority)
This method overrides the method in super. |
void |
setPriority(LogPriority priority)
This method overrides the method in super. |
void |
setPriority(java.lang.String strPriority)
This method overrides the method in super. |
java.lang.String |
toString()
|
void |
warn(java.lang.String strKey)
Log a message with the warn priority. |
void |
warn(java.lang.String message,
boolean isDirect)
Log a message with the warn priority. |
void |
warn(java.lang.String strKey,
java.lang.Object obj)
Convenience method which allows the user to log a warn message with one argument to fill into the template. |
void |
warn(java.lang.String strKey,
java.lang.Object[] aInfo)
Log a message with the warn priority. |
void |
warn(java.lang.Throwable exception)
Log a message with the error priority. |
Methods inherited from class org.apache.log4j.Category |
addAppender,
assert,
callAppenders,
debug,
debug,
error,
error,
exists,
fatal,
fatal,
forcedLog,
getAdditivity,
getAllAppenders,
getAppender,
getChainedPriority,
getCurrentCategories,
getDefaultHierarchy,
getHierarchy,
getInstance,
getInstance,
getName,
getPriority,
getResourceBundle,
getResourceBundleString,
getRoot,
info,
info,
isDebugEnabled,
isEnabledFor,
isInfoEnabled,
l7dlog,
l7dlog,
log,
log,
log,
removeAllAppenders,
removeAppender,
removeAppender,
setAdditivity,
setPriority,
setResourceBundle,
shutdown,
warn,
warn |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
Field Detail |
public static LogCategory.LogCategoryFactory c_categoryFactory
Constructor Detail |
public LogCategory(java.lang.String strContext)
strContext
- - identifies the category to log messages to...Method Detail |
public static org.apache.log4j.Category getInstance(java.lang.String name)
public static LogCategory getCategory(org.apache.log4j.Hierarchy hierarchy, LogContext context, java.util.ResourceBundle bundle)
hierarchy
- - the category hierarchy to retrieve the LogCategory from;
hierarchies are maintained for each active locale.context
- is a LogContext object containing the name of the
LogCategorybundle
- - the message bundle for a log context; ResourceBundles are
managed by the LogManager.public void addRuntimeDestination(java.io.PrintWriter writer)
public java.io.PrintWriter getLogWriter()
public void setPriority(int intPriority)
intPriority
- is an integer that represents a logging priority level.
See com.bea.logging.LogPriority
for a set of static int values to use.public void setPriority(java.lang.String strPriority)
strPriority
- is a String name for an existing priority level.public void setPriority(LogPriority priority)
priority
- is a LogPriority object, which is constructed
using one of the static int values in LogPriority
as its argument.public java.lang.String getI18NMessage(java.lang.String strKey)
strKey
- is a String key for lookup of a message in a ResourceBundlepublic java.lang.String getI18NMessage(java.lang.String strKey, java.lang.Object[] aInfo)
strKey
- is a String key for lookup of a message in a ResourceBundleaInfo
- is an Object[] of parameters to be replaced in the template
returned by the key, strKey.public java.lang.String getI18NMessage(java.lang.String strKey, java.lang.Object obj)
strKey
- is a String key for lookup of a message in a ResourceBundleobj
- is typically a String which will be added to an Object[], and
replaced on the underlying message template.protected java.lang.String formatMessage(java.lang.String strTemplateKey, java.lang.Object[] aObj)
strTemplate
- is a "pattern" used by MessageFormat objectaObj
- is an Object[] of parameters for replacement in the Patternpublic void audit(java.lang.String strKey)
public void audit(java.lang.String message, boolean isDirect)
message
- is just that, don't use it as a key for lookupisDirect
- should be set to true (yeah, this is stupid)
but necessary!public void audit(java.lang.String strKey, java.lang.Object[] aInfo)
strKey
- is a String key for looking up the template in the
resource bundle.aInfo
- is an Object[] of params to use with the specified templatepublic void audit(java.lang.String strKey, java.lang.Object obj)
strKey
- is a String key for looking up the template in the
resource bundle.obj
- is an object (typically a String) to use with the specified templatepublic void audit(java.lang.Throwable exception)
exception
- is the exception to log. We include a stack trace in the
log message.public void error(java.lang.String strKey)
strKey
- used as a key for lookup of the actual message.public void error(java.lang.String message, boolean isDirect)
message
- is just that, don't use it as a key for lookupisDirect
- should be set to true (yeah, this is stupid)public void error(java.lang.String strKey, java.lang.Object[] aInfo)
strKey
- is a String key for looking up the template in the
resource bundle.aInfo
- is an Object[] of params to use with the specified templatepublic void error(java.lang.String strKey, java.lang.Object obj)
strKey
- is a String key for looking up the template in the
resource bundle.obj
- is an object (typically a String) to use with the specified templatepublic void error(java.lang.Throwable exception)
exception
- is the exception to log. We include a stack trace in the
log message.public void warn(java.lang.String strKey)
strKey
- used as a key for lookup of the actual message.public void warn(java.lang.String message, boolean isDirect)
message
- is just that, don't use it as a key for lookupisDirect
- should be set to true (yeah, this is stupid)public void warn(java.lang.String strKey, java.lang.Object[] aInfo)
strKey
- is a String key for looking up the template in the
resource bundle.aInfo
- is an Object[] of params to use with the specified templatepublic void warn(java.lang.String strKey, java.lang.Object obj)
strKey
- is a String key for looking up the template in the
resource bundle.obj
- is an object (typically a String) to use with the specified templatepublic void warn(java.lang.Throwable exception)
exception
- is the exception to log. We include a stack trace in the
log message.public void info(java.lang.String strKey)
strKey
- is a key for message lookuppublic void info(java.lang.String message, boolean isDirect)
message
- is just that, don't use it as a key for lookupisDirect
- should be set to true (yeah, this is stupid)public void info(java.lang.String strKey, java.lang.Object[] aInfo)
strKey
- is a String key for looking up the template in the
resource bundle.aInfo
- is an Object[] of params to use with the specified templatepublic void info(java.lang.String strKey, java.lang.Object obj)
strKey
- is a String key for looking up the template in the
resource bundle.obj
- is an object (typically a String) to use with the specified templatepublic void debug(java.lang.String strMessage)
strMessage
- is a messagepublic INestedDiagnosticContext getNDCInterface()
public void clearNDC()
public java.util.Stack cloneNDCStack()
public java.lang.String getNDC()
public int getNDCDepth()
public void inheritNDC(java.util.Stack stack)
public void popNDC()
public void pushNDC(java.lang.String message)
public void removeNDC()
public void setNDCMaxDepth(int depth)
public java.lang.String toString()
protected java.lang.String getCategoryInfo(org.apache.log4j.Category c)
public static void dumpCategories()
|
WebLogic Integration | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |