[Koha-devel] RFC: Koha needs a logger!

Marc Balmer marc at msys.ch
Fri Sep 14 18:20:13 CEST 2012


Am 14.09.12 16:09, schrieb Kyle Hall:
> Hey all,
> 
> I've been thinking about this for quite a while now. I feel that Koha
> would benefit greatly from having a traditional logger, rather than
> relying on warn's being written to the apache logs. This would give us
> many benefits. First, we would be able to log everything to one or
> more standard files, regardless of whether that file was running under
> apache or not. Second, we could implement standard logging levels (
> trace, debug, info, warn, error, fatal ). It would also help us debug
> ajax-related issues where child processes no longer write to the
> apache module.
> 
> The Catalyst Perl framework has been a primary inspiration for this.
> We could have C4::Context->log->debug('this is a test message'); Our
> logger would detect the current error level and output or ignore the
> message accordingly.
> 
> My research has lead me to Log4perl, which seems to be an outstanding
> logging module. It can even capture existing warns and dies. It would
> work perfectly except for one scenario I was hoping for.
> 
> I have been thinking it might be useful for developers and even just
> experienced Koha users of the we could dump all the log output to the
> webpage. So mainpage.pl?debug=1 would not only enable debug messages,
> but then append all those debug messages to the bottom of the returned
> html. Log4perl is meant to be used as a singleton, so even if we can
> get the logged message back out, it would have messages from other
> koha scripts that were running concertedly. If I am incorrect, please
> let me know!
> 
> So the options are:
> 1) Forget about the dump-to-screen feature, and just use Log4perl
> 2) Write our own logger from scratch with all these features, largely
> duplicating the effor of Log4perl and other loggers
> 3) Write our own logger that can handle the dump-to-screen feature,
> but use Log4perl within Koha::Logger for all other logging.
> 
> Another idea, implement dbi tracing to allow dumping of all queries to
> the screen and log. Also, Perhaps the dump-to-screen could create a
> popup window instead of appending to the bottom of the screen.

I generally agree to the idea, I would, however, favour a solution that
uses the Unix sylog mechanism under the hood.

- Marc

> 
> I'm looking for any and all opinions or ideas on this subject.
> 
> Thanks!
> Kyle
> 
> http://www.kylehall.info
> ByWater Solutions ( http://bywatersolutions.com )
> Meadville Public Library ( http://www.meadvillelibrary.org )
> Crawford County Federated Library System ( http://www.ccfls.org )
> Mill Run Technology Solutions ( http://millruntech.com )
> _______________________________________________
> Koha-devel mailing list
> Koha-devel at lists.koha-community.org
> http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel
> website : http://www.koha-community.org/
> git : http://git.koha-community.org/
> bugs : http://bugs.koha-community.org/
> 



More information about the Koha-devel mailing list