|
Log4j 1.2.8 | |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.log4j.spi.LocationInfo
The internal representation of caller location information.
Field Summary | |
---|---|
java.lang.String |
fullInfo
All available caller information, in the format fully.qualified.classname.of.caller.methodName(Filename.java:line) |
static java.lang.String |
NA
When location information is not available the constant NA is returned. |
Constructor Summary | |
---|---|
LocationInfo(java.lang.Throwable t,
java.lang.String fqnOfCallingClass)
Instantiate location information based on a Throwable. |
Method Summary | |
---|---|
java.lang.String |
getClassName()
Return the fully qualified class name of the caller making the logging request. |
java.lang.String |
getFileName()
Return the file name of the caller. |
java.lang.String |
getLineNumber()
Returns the line number of the caller. |
java.lang.String |
getMethodName()
Returns the method name of the caller. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public java.lang.String fullInfo
fully.qualified.classname.of.caller.methodName(Filename.java:line)
public static final java.lang.String NA
NA
is returned. Current value of this string
constant is ?.
Constructor Detail |
public LocationInfo(java.lang.Throwable t, java.lang.String fqnOfCallingClass)
t
, to be in the format
java.lang.Throwable ... at org.apache.log4j.PatternLayout.format(PatternLayout.java:413) at org.apache.log4j.FileAppender.doAppend(FileAppender.java:183) at org.apache.log4j.Category.callAppenders(Category.java:131) at org.apache.log4j.Category.log(Category.java:512) at callers.fully.qualified.className.methodName(FileName.java:74) ...
However, we can also deal with JIT compilers that "lose" the location information, especially between the parentheses.
Method Detail |
public java.lang.String getClassName()
public java.lang.String getFileName()
This information is not always available.
public java.lang.String getLineNumber()
This information is not always available.
public java.lang.String getMethodName()
|
Log4j 1.2.8 | |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |