|
From: Semyon K. <skl...@in...> - 2009-04-23 14:12:16
|
Hi,
I have a some difficulties in creating of custom layout.
I have derived base log4cplus::Layout class:
class LogLayout : public Layout
{
public:
LogLayout(void);
~LogLayout(void);
virtual void formatAndAppend(log4cplus::tostream& output, const
log4cplus::spi::InternalLoggingEvent& event);
};
The problem is that in formatAndAppend function parameters there is an
InternalLoggingEvent object only and I have no way to put my parameters
there.
The only way I found is to format the message before I send it to
logger:
void LogLayout::formatAndAppend(log4cplus::tostream& output,
const log4cplus::spi::InternalLoggingEvent& event)
{
output << event.getMessage();
}
Could you please explain me what is the right way to create a custom
layout?
Thank you,
Semyon
|