Re: Log::XML - Request for Comments, preparing the package for a vote

From: Date: Thu, 25 Jun 2009 03:30:05 +0000
Subject: Re: Log::XML - Request for Comments, preparing the package for a vote
References: 1 2 3  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-52053@lists.php.net to get a copy of this message
Thank you for the comments Christian and Mike, That is a very good point about calling DOM libraries, I didn't have experience with massive log files when I first wrote this (I've since got my first big time coding job). One of the things I wanted to support was real-time viewing of the log as it is being generated. I was looking at log4j recently and in XML mode it will have the header in one file and the individual log events in another file, referenced via an external entities tag. Do you think this would be the best way to go? (Log4j XML link: http://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/xml/XMLLayout.html ). As far as XML libraries I'll look at XMLWritier and see if I could factor out all library calls so that the library could be easily changed to any arbitrary library. So to summarize thank you for the good points. What do you think of keeping the header and log statements in separate files and linking them with an XML external entities reference? Lastly what do you think of factoring out XML library calls? Thank you, Michael Gower On Wed, Jun 24, 2009 at 1:41 PM, Michael Gauthier <mike@silverorange.com>wrote: > 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 > > > -- > PEAR Development Mailing List (http://pear.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > >

« previous php.pear.dev (#52053) next »