示例#1
0
  virtual void append(const log4cxx::spi::LoggingEventPtr& event, log4cxx::helpers::Pool& pool)
  {
    Info info;
    info.level_ = event->getLevel();
    info.message_ = event->getMessage();
    info.logger_name_ = event->getLoggerName();

    info_.push_back( info );
  }
示例#2
0
void LogServiceAppender::append(const log4cxx::spi::LoggingEventPtr& event)
{
    // custom layouts is not supported for log4cxx library
    std::string formatted_string(boost::lexical_cast<std::string>(event->getTimeStamp()));
    formatted_string += ' ';
    formatted_string += event->getLevel()->toString();
    formatted_string += ' ';
    formatted_string += event->getLoggerName();
    formatted_string += " - ";
    formatted_string += event->getRenderedMessage();
    formatted_string += '\n';
    addLogString(formatted_string);
}