[pLog-svn] r847 - in plog/trunk/class: locale template/menu

Oscar Renalias phunkphorce at gmail.com
Tue Feb 1 08:27:17 GMT 2005


well never mind about my previous question. I had a look at PEAR::Log
but we don't need that much either so I started to create our own
custom logging engine. A very simple one, with code borrowed from our
"sister" [q]framework :) and using ideas from log4php but at a much
smaller scale. The class interface will be exactly the same so there
is no need to change any code.

By the way, we should remove any reference to logging in the final
version for several reasons:

1) logging slows down the code, even if disabled because at least we
need to execute some extra code in order to check whether logging is
enabled or not.

2) the size of objects and the memory needed to store them grows a bit
because each Object has a pointer to a logger.

How about a script that would search for all calls to
$this->log->debug() and remove them?

Oscar

On Sun, 30 Jan 2005 20:34:59 +0200, Oscar Renalias <oscar at renalias.net> wrote:
> you can switch logging off if needed :) Just edit the
> config/log4php.properties. But don't ask me how to disble it :D (try
> removing everything from it, perhaps it will help!)
> 
> Oscar
> 
> On 30 Jan 2005, at 20:31, Mark Wu wrote:
> 
> > It seems a good idea.
> >
> > I just run plogworld.org.tw for 17 days, and the log file is about
> > 35MB, and
> > how terrible it is.
> >
> > I just see PEAR provide a standard logging library...
> >
> > http://pear.php.net/package/Log
> >
> > Maybe we can try it...
> >
> > Regards, Mark
> >
> > -----Original Message-----
> > From: plog-svn-bounces at devel.plogworld.net
> > [mailto:plog-svn-bounces at devel.plogworld.net] On Behalf Of Oscar
> > Renalias
> > Sent: Monday, January 31, 2005 2:10 AM
> > To: plog-svn at devel.plogworld.net
> > Subject: Re: [pLog-svn] r847 - in plog/trunk/class: locale
> > template/menu
> >
> > I'm starting to be suspicious of log4php... The whole thing is just
> > huge and
> > each one of our objects (or any object which extends Object) inherits
> > a $log
> > object which is a pointer to a log4php logger. If you try to serialize
> > one
> > of these, you'll see what I mean by huge.
> >
> > I'm thinking that we should get rid of it to see if it solves our
> > problems.
> > Memory-wise, we're not doing so many more things than in 0.3.x so this
> > could
> > very well be the reason. We should either replace log4php with a
> > smaller
> > package providing similar functionality or implement our own logger.
> > After
> > all, we're using like 5% of log4php's power and it shouldn't be too
> > difficult to implmement our own (which is the 2nd alternative) while
> > keeping
> > the same interface.
> >
> > Any ideas?
> >
> > Sorry to be so pushy, but would be good to have something to test
> > during
> > this week... (so that potential testers don't get too disappointed too
> > early!)
> >
> > Oscar
> >
> > On 27 Jan 2005, at 03:32, Benjamin Krause wrote:
> >
> >> Oscar Renalias wrote:
> >>
> >>> doing some memory profiling would be interesting but it could also
> >>> take a lot of time and I am not sure if there are any good tools for
> >>> doing this kind of things in php... It could be a pain to do this
> >>> manually!
> >>
> >> hey ...
> >>
> >> i've installed xdebug and did some profiling.. i'll investigate even
> >> further the next days and send you a short report :)
> >>
> >> there are still a lot of possible warnings.. esp. in PHP5 .. xdebug
> >> does a good job analysing the code ...
> >>
> >> http://www.xdebug.org/
> >>
> >> Ben
> >>
> >>
> >
> > _______________________________________________
> > pLog-svn mailing list
> > pLog-svn at devel.plogworld.net
> > http://devel.plogworld.net/mailman/listinfo/plog-svn
> >
> > _______________________________________________
> > pLog-svn mailing list
> > pLog-svn at devel.plogworld.net
> > http://devel.plogworld.net/mailman/listinfo/plog-svn
> >
> 
> _______________________________________________
> pLog-svn mailing list
> pLog-svn at devel.plogworld.net
> http://devel.plogworld.net/mailman/listinfo/plog-svn
>



More information about the pLog-svn mailing list