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

Kyle Hall kyle.m.hall at gmail.com
Fri Sep 14 19:54:39 CEST 2012


That is interesting. Is there a good argument for using something like
this over Log4perl?

The big question I have is: Would being able to output debug messages
to the web browser be useful enough to make it work implement?

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 )


On Fri, Sep 14, 2012 at 10:16 AM, Jonathan Druart
<jonathan.druart at biblibre.com> wrote:
> Hi Kyle,
>
> I already launched this discussion and proposed a patch (Bug 8190). It is
> waiting for a signoff for 2 months...
>
> Please have a look before starting a development :)
>
> Regards,
> Jonathan
>
> 2012/9/14 Kyle Hall <kyle.m.hall at gmail.com>
>>
>> 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'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