l4snd::XmlFormatter Class Reference

Message formatting in log4j xml layout. More...

Inheritance diagram for l4snd::XmlFormatter:

Inheritance graph
[legend]
Collaboration diagram for l4snd::XmlFormatter:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 XmlFormatter (const std::string &appname)
 Constructs the formatter.
 XmlFormatter (const std::string &appname, const std::string &hostname)
 Constructs the formatter.
virtual std::vector
< std::string > 
format (Logger::Level level, const std::string &msg, std::string category, LOG4SENDPP_INT64 stamp, const LocationInformation *loginfo, const Logger::DiagnosticInformation *diaginfo)
 Formats a message.

Static Public Member Functions

static std::string xmlEscape (const std::string &msg)
 Replaces dangerous xml literals.


Detailed Description

Message formatting in log4j xml layout.

Definition at line 43 of file xmlformatter.h.


Constructor & Destructor Documentation

l4snd::XmlFormatter::XmlFormatter ( const std::string &  appname  ) 

Constructs the formatter.

Sets also the hostname.

Parameters:
appname application name

Definition at line 62 of file xmlformatter.cpp.

References l4snd::TcpIpAppender::gethostname().

l4snd::XmlFormatter::XmlFormatter ( const std::string &  appname,
const std::string &  hostname 
)

Constructs the formatter.

Parameters:
appname application name
hostname hostname

Definition at line 52 of file xmlformatter.cpp.


Member Function Documentation

std::vector< std::string > l4snd::XmlFormatter::format ( Logger::Level  level,
const std::string &  msg,
std::string  category,
LOG4SENDPP_INT64  stamp,
const LocationInformation loginfo,
const Logger::DiagnosticInformation diaginfo 
) [virtual]

Formats a message.

Parameters:
level severty level
msg string to log
category message category
stamp timestamp in milliseconds since 1.1.1970
loginfo pointer to location info or 0
diaginfo pointer to diagnostic info or 0
Returns:
formatted message in one or more lines

Implements l4snd::Formatter.

Definition at line 78 of file xmlformatter.cpp.

References l4snd::Logger::Debug, l4snd::Logger::Error, l4snd::Logger::Fatal, l4snd::Logger::Info, l4snd::number(), l4snd::Logger::Trace, l4snd::Logger::Warning, and xmlEscape().

std::string l4snd::XmlFormatter::xmlEscape ( const std::string &  msg  )  [static]

Replaces dangerous xml literals.

Parameters:
msg message
Returns:
escaped message

Definition at line 71 of file xmlformatter.cpp.

Referenced by format().


The documentation for this class was generated from the following files:
Generated on Sat Nov 24 14:41:27 2007 for log4sendpp by  doxygen 1.5.3