Re: Log::XML - Request for Comments, preparing the package for a vote
| From: | Michael Gauthier | Date: | Wed, 24 Jun 2009 20:41:20 +0000 |
| Subject: | Re: Log::XML - Request for Comments, preparing the package for a vote | ||
| References: | 1 2 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-52049@lists.php.net to get a copy of this message | ||
On Wed, 2009-06-24 at 19:46 +0200, Christian Weiske wrote:
>
> Another question for me would be: How does Log_XML handle millions of
> log entries? I saw that you use a DOM object and store all log
> messages in it, saving it into a file at the end. This will fail if
> there is not much memory available and/or really much data get logged.
> A better approach - IMO would be to write the XML head at first
> (without closing tag) and each log message - as an xml
> document - separately - without the xml header of course. When closing,
> the finishing XML tag is written.
> I did this when exporting some 1.5GiB of product data out of a shop
> database into an xml file.
> I think it's a bad base if you expect all log_xml drivers to use DOM -
> that does not work.
>
>
You might also consider the XMLWriter built into PHP5 (>=5.1.2):
http://ca3.php.net/manual/en/book.xmlwriter.php
It provides an API to do basically what Christian suggests.
Cheers,
Mike