0

How can one create valid XML files using log4php? The file is not created with valid XML headers. I am using the append option, so I understand I can append to a proper file, but if I want to start a new file I have to make one each time. There must be a proper way to include the XML header if the file is new?

return array(
    'appenders' => array(
        'default' => array(
            'class' => 'LoggerAppenderFile',
            'layout' => array(
                'class' => 'LoggerLayoutXml',
            ),
            'params' => array(
                'file' => $_SERVER['DOCUMENT_ROOT'] . '/logs/log.xml',
                'append' => true
            ),
        ),
    ),
    'rootLogger' => array(
        'appenders' => array('default'),
    ),
);

This is my config setup.

Chetan Ameta
  • 7,696
  • 3
  • 29
  • 44
user3822370
  • 641
  • 7
  • 20

0 Answers0