Inheritance diagram for XMLLayout:
Public Member Functions | |
void | setLocationInfo (bool locationInfo) |
bool | getLocationInfo () const |
void | activateOptions () |
virtual void | setOption (const String &option, const String &value) |
virtual void | format (ostream &output, const spi::LoggingEventPtr &event) const |
virtual bool | ignoresThrowable () const |
For example, if abc
is the name of the file where the XMLLayout ouput goes, then a well-formed XML file would be:
<?xml version="1.0" ?>
<!DOCTYPE log4j:eventSet SYSTEM "log4j.dtd" [<!ENTITY data SYSTEM "abc">]>
<log4j:eventSet version="1.2" xmlns:log4j="http://jakarta.apache.org/log4j/">
&data;
</log4j:eventSet>
This approach enforces the independence of the XMLLayout and the appender where it is embedded.
void activateOptions | ( | ) | [inline, virtual] |
No options to activate.
Implements OptionHandler.
void format | ( | ostream & | output, | |
const spi::LoggingEventPtr & | event | |||
) | const [virtual] |
Formats a LoggingEvent in conformance with the log4cxx.dtd.
Normally a sort isn't required, but for Test Case purposes we need to guarantee a particular order.
Besides which, from a human readable point of view, the sorting of the keys is kinda nice..
Implements Layout.
bool getLocationInfo | ( | ) | const [inline] |
Returns the current value of the LocationInfo option.
virtual bool ignoresThrowable | ( | ) | const [inline, virtual] |
void setLocationInfo | ( | bool | locationInfo | ) | [inline] |
The LocationInfo option takes a boolean value. By default, it is set to false which means there will be no location information output by this layout. If the the option is set to true, then the file name and line number of the statement at the origin of the log statement will be output.
If you are embedding this layout within a SMTPAppender then make sure to set the LocationInfo option of that appender as well.
void setOption | ( | const String & | option, | |
const String & | value | |||
) | [virtual] |
Set options
Implements OptionHandler.