[Koha-bugs] [Bug 8190] Koha does not have a logging module

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Mon Sep 17 17:55:37 CEST 2012


http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8190

Kyle M Hall <kyle at bywatersolutions.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #12264|0                           |1
        is obsolete|                            |

--- Comment #16 from Kyle M Hall <kyle at bywatersolutions.com> ---
Created attachment 12282
  -->
http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=12282&action=edit
Bug 8190: Koha::Utils::Logger, Logging module

use Koha::Utils::Logger qw/$log/;
$log = Koha::Utils::Logger->new;
$log->debug("This is a debug message");
$log->info("This is an information");
$log->error("This is an error !");

The Logger constructor can take an hash reference with "file" and
"level" to define a filepath or a log level.

For a log level >= warning, a call stack is printed.

Prerequisite:
- set an environment variable KOHA_LOG in your virtual host:
    SetEnv KOHA_LOG /home/koha/var/log/opac.log
- set a write flag for www-data on this file

  Please have a look at t/Logger.t for more details.

Signed-off-by: Mason James <mtj at kohaaloha.com>
Signed-off-by: Kyle M Hall <kyle at bywatersolutions.com>

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list