ulxr::Log4JSender Class Reference

Simple logger support class based on log4j. More...

#include <ulxr_log4j.h>

Collaboration diagram for ulxr::Log4JSender:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 Log4JSender (const CppString &appname, TcpIpConnection &conn)
 Creates the Log4JSender object.
 ~Log4JSender () throw ()
 Destructs Log4JSender object.
void open ()
 Opens the connection.
void close ()
 Closes the connection.
void send (const CppString &level, const CppString &message, const CppString &filename=ULXR_PCHAR(""), unsigned line=0)
 Sends a message to the log host.
ULXR_INT64 currentTimeMillis ()
 The number of milliseconds elapsed from 1/1/1970 until logging event was created.

Private Attributes

CppString appname
TcpIpConnectionconn
bool network_error
CppString threadname
unsigned long seqnum
std::string hostname
bool disable_send
CppString classname
CppString methodname
bool first_log4j

Detailed Description

Simple logger support class based on log4j.

Definition at line 44 of file ulxr_log4j.h.


Constructor & Destructor Documentation

ulxr::Log4JSender::Log4JSender ( const CppString appname,
TcpIpConnection conn 
)

Creates the Log4JSender object.

Definition at line 62 of file ulxr_log4j.cpp.

References hostname, and open().

ulxr::Log4JSender::~Log4JSender (  )  throw ()

Destructs Log4JSender object.

Definition at line 79 of file ulxr_log4j.cpp.


Member Function Documentation

void ulxr::Log4JSender::open (  ) 

Opens the connection.

Definition at line 99 of file ulxr_log4j.cpp.

References conn, disable_send, first_log4j, ulxr::Connection::isOpen(), network_error, and ulxr::TcpIpConnection::open().

Referenced by Log4JSender().

void ulxr::Log4JSender::close (  ) 

Closes the connection.

Definition at line 84 of file ulxr_log4j.cpp.

References ulxr::TcpIpConnection::close(), conn, disable_send, ulxr::Connection::isOpen(), and network_error.

void ulxr::Log4JSender::send ( const CppString level,
const CppString message,
const CppString filename = ULXR_PCHAR(""),
unsigned  line = 0 
)

Sends a message to the log host.

Parameters:
level debug Level
message debug message
filename filename of message origin
line line number in filename

Definition at line 135 of file ulxr_log4j.cpp.

References appname, ulxr::asciiToUtf8(), classname, conn, currentTimeMillis(), disable_send, first_log4j, ulxr::getLatin1(), hostname, ulxr::HtmlFormHandler::makeNumber(), methodname, network_error, seqnum, threadname, ULXR_PCHAR, ulxr::unicodeToUtf8(), ulxr::Connection::write(), and ulxr::xmlEscape().

ULXR_INT64 ulxr::Log4JSender::currentTimeMillis (  ) 

The number of milliseconds elapsed from 1/1/1970 until logging event was created.

Returns:
current value of milliseconds

Definition at line 117 of file ulxr_log4j.cpp.

References ULXR_INT64.

Referenced by send().


Member Data Documentation

CppString ulxr::Log4JSender::appname [private]

Definition at line 81 of file ulxr_log4j.h.

Referenced by send().

TcpIpConnection& ulxr::Log4JSender::conn [private]

Definition at line 82 of file ulxr_log4j.h.

Referenced by close(), open(), and send().

bool ulxr::Log4JSender::network_error [private]

Definition at line 83 of file ulxr_log4j.h.

Referenced by close(), open(), and send().

CppString ulxr::Log4JSender::threadname [private]

Definition at line 84 of file ulxr_log4j.h.

Referenced by send().

unsigned long ulxr::Log4JSender::seqnum [private]

Definition at line 85 of file ulxr_log4j.h.

Referenced by send().

std::string ulxr::Log4JSender::hostname [private]

Definition at line 86 of file ulxr_log4j.h.

Referenced by Log4JSender(), and send().

bool ulxr::Log4JSender::disable_send [private]

Definition at line 87 of file ulxr_log4j.h.

Referenced by close(), open(), and send().

CppString ulxr::Log4JSender::classname [private]

Definition at line 88 of file ulxr_log4j.h.

Referenced by send().

CppString ulxr::Log4JSender::methodname [private]

Definition at line 89 of file ulxr_log4j.h.

Referenced by send().

bool ulxr::Log4JSender::first_log4j [private]

Definition at line 90 of file ulxr_log4j.h.

Referenced by open(), and send().


The documentation for this class was generated from the following files:
Generated on Sun Aug 19 20:09:06 2007 for ulxmlrpcpp by  doxygen 1.5.1