I have semi-colon separated values logged to a csv file using log4php. I wanted to write a header in first line. How this can be done?
Example
message id, file name, start time, end time, status MSGID1000;SAMPLE.TXT;01:05:55;07:08:44;OK MSGID1000;SAMPLE.TXT;01:05:55;07:08:44;NOK
I do this
csvLogger = Logger::getRootLogger();
csvLogger->setLevel(LoggerLevel::toLevel(LoggerLevel::DEBUG));
csvLogger->removeAllAppenders();
$appender = new LoggerAppenderFile("csvLogAppender");
$appender->setFile("LogMessage.csv");
$appender->setAppend(false);
csvLogger->addAppender($appender);