java.lang.Object | |
↳ | org.apache.log4j.spi.LocationInfo |
The internal representation of caller location information.
Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
String | NA | When location information is not available the constant
NA is returned. |
Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
NA_LOCATION_INFO | NA_LOCATION_INFO is provided for compatibility with log4j 1.3. | ||||||||||
fullInfo | All available caller information, in the format
fully.qualified.classname.of.caller.methodName(Filename.java:line)
|
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Instantiate location information based on a Throwable.
| |||||||||||
Create new instance.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Return the fully qualified class name of the caller making the
logging request.
| |||||||||||
Return the file name of the caller.
| |||||||||||
Returns the line number of the caller.
| |||||||||||
Returns the method name of the caller.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
|
When location information is not available the constant
NA
is returned. Current value of this string
constant is ?.
NA_LOCATION_INFO is provided for compatibility with log4j 1.3.
All available caller information, in the format
fully.qualified.classname.of.caller.methodName(Filename.java:line)
Instantiate location information based on a Throwable. We
expect the Throwable 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.
t | throwable used to determine location, may be null. |
---|---|
fqnOfCallingClass | class name of first class considered part of the logging framework. Location will be site that calls a method on this class. |
Create new instance.
file | source file name |
---|---|
classname | class name |
method | method |
line | source line number |
Return the fully qualified class name of the caller making the logging request.
Return the file name of the caller.
This information is not always available.
Returns the line number of the caller.
This information is not always available.
Returns the method name of the caller.