|
JBoss Log Manager 1.4.0.Final | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.util.logging.LogRecord
org.jboss.logmanager.ExtLogRecord
public class ExtLogRecord
An extended log record, which includes additional information including MDC/NDC and correct caller location (even in the presence of a logging facade).
| Nested Class Summary | |
|---|---|
static class |
ExtLogRecord.FormatStyle
The format style to use. |
| Constructor Summary | |
|---|---|
ExtLogRecord(ExtLogRecord original)
Make a copy of a log record. |
|
ExtLogRecord(Level level,
String msg,
ExtLogRecord.FormatStyle formatStyle,
String loggerClassName)
Construct a new instance. |
|
ExtLogRecord(Level level,
String msg,
String loggerClassName)
Construct a new instance. |
|
| Method Summary | |
|---|---|
void |
copyAll()
Copy all fields and prepare this object to be passed to another thread or to be serialized. |
void |
copyMdc()
Copy the MDC. |
void |
disableCallerCalculation()
Disable caller calculation for this record. |
ExtLogRecord.FormatStyle |
getFormatStyle()
Get the format style for the record. |
String |
getFormattedMessage()
Get the fully formatted log record, with resources resolved and parameters applied. |
String |
getLoggerClassName()
Get the class name of the logger which created this record. |
String |
getMdc(String key)
Get the value of an MDC property. |
Map<String,String> |
getMdcCopy()
Get a copy of all the MDC properties for this log record. |
String |
getNdc()
Get the NDC for this log record. |
String |
getResourceKey()
Get the resource key, if any. |
String |
getSourceClassName()
|
String |
getSourceFileName()
Get the source file name for this log record. |
int |
getSourceLineNumber()
Get the source line number for this log record. |
String |
getSourceMethodName()
|
String |
getThreadName()
Get the thread name of this logging event. |
String |
putMdc(String key,
String value)
Change an MDC value on this record. |
String |
removeMdc(String key)
Remove an MDC value on this record. |
void |
setMdc(Map<?,?> sourceMap)
Create a new MDC using a copy of the source map. |
void |
setMessage(String message)
Set the raw message. |
void |
setMessage(String message,
ExtLogRecord.FormatStyle formatStyle)
Set the raw message. |
void |
setNdc(String value)
Change the NDC for this log record. |
void |
setParameters(Object[] parameters)
Set the parameters to the log message. |
void |
setResourceBundle(ResourceBundle bundle)
Set the localization resource bundle. |
void |
setResourceBundleName(String name)
Set the localization resource bundle name. |
void |
setSourceClassName(String sourceClassName)
|
void |
setSourceFileName(String sourceFileName)
Set the source file name for this log record. |
void |
setSourceLineNumber(int sourceLineNumber)
Set the source line number for this log record. |
void |
setSourceMethodName(String sourceMethodName)
|
void |
setThreadName(String threadName)
Set the thread name of this logging event. |
static ExtLogRecord |
wrap(LogRecord rec)
Wrap a JDK log record. |
| Methods inherited from class java.util.logging.LogRecord |
|---|
getLevel, getLoggerName, getMessage, getMillis, getParameters, getResourceBundle, getResourceBundleName, getSequenceNumber, getThreadID, getThrown, setLevel, setLoggerName, setMillis, setSequenceNumber, setThreadID, setThrown |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ExtLogRecord(Level level,
String msg,
String loggerClassName)
level - a logging level valuemsg - the raw non-localized logging message (may be null)loggerClassName - the name of the logger class
public ExtLogRecord(Level level,
String msg,
ExtLogRecord.FormatStyle formatStyle,
String loggerClassName)
level - a logging level valuemsg - the raw non-localized logging message (may be null)formatStyle - the parameter format style to useloggerClassName - the name of the logger classpublic ExtLogRecord(ExtLogRecord original)
original - the original| Method Detail |
|---|
public static ExtLogRecord wrap(LogRecord rec)
ExtLogRecord, it is simply returned. Otherwise
a wrapper record is created and returned.
rec - the original record
public void disableCallerCalculation()
"unknown".
public void copyAll()
public void copyMdc()
public String getMdc(String key)
key - the property key
public Map<String,String> getMdcCopy()
public String putMdc(String key,
String value)
key - the key to setvalue - the value to set it to
public String removeMdc(String key)
key - the key to remove
public void setMdc(Map<?,?> sourceMap)
sourceMap - the source man, must not be nullpublic String getNdc()
public void setNdc(String value)
value - the new NDC valuepublic String getLoggerClassName()
public ExtLogRecord.FormatStyle getFormatStyle()
public int getSourceLineNumber()
public void setSourceLineNumber(int sourceLineNumber)
sourceLineNumber - the source line numberpublic String getSourceFileName()
null if no information could be obtained.
public void setSourceFileName(String sourceFileName)
sourceFileName - the source file namepublic String getSourceClassName()
getSourceClassName in class LogRecordpublic void setSourceClassName(String sourceClassName)
setSourceClassName in class LogRecordpublic String getSourceMethodName()
getSourceMethodName in class LogRecordpublic void setSourceMethodName(String sourceMethodName)
setSourceMethodName in class LogRecordpublic String getFormattedMessage()
public String getResourceKey()
null.
public String getThreadName()
public void setThreadName(String threadName)
threadName - the thread namepublic void setMessage(String message)
MessageFormat-style.
setMessage in class LogRecordmessage - the new raw message
public void setMessage(String message,
ExtLogRecord.FormatStyle formatStyle)
message - the new raw messageformatStyle - the format style to usepublic void setParameters(Object[] parameters)
setParameters in class LogRecordparameters - the log message parameters. (may be null)public void setResourceBundle(ResourceBundle bundle)
setResourceBundle in class LogRecordbundle - localization bundle (may be null)public void setResourceBundleName(String name)
setResourceBundleName in class LogRecordname - localization bundle name (may be null)
|
JBoss Log Manager 1.4.0.Final | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||