1<?php
2
3use Monolog\Formatter\LineFormatter;
4use Monolog\Handler\ErrorLogHandler;
5use Monolog\Logger;
6
7/**
8 * dist.loghandler.php
9 *
10 ****************************
11 ** DO NOT EDIT THIS FILE! **
12 ****************************
13 *
14 * You are free to copy this file as "loghandler.php" and make any
15 * modification you need. This allows you to make customization that will not
16 * be overwritten during an update.
17 *
18 * WHMCS will attempt to load your custom "loghandler.php" instead of this
19 * file ("dist.loghandler.php").
20 *
21 ****************************
22 ** DO NOT EDIT THIS FILE! **
23 ****************************
24 *
25 * The WHMCS initializes a Monolog logger, exposing the handler for customization.
26 *
27 * You are free to customize the handlers by modify this file to your needs.
28 *
29 * By default, WHMCS will log all messages to the configured PHP error log
30 * (i.e., the Apache webserver error log).
31 *
32 * NOTE:
33 * * The applications handler by default, as defined here, will log at the
34 * 'warning' level, if most verbose is required, consider 'info' or 'debug'
35 *
36 * Please see Monolog documentation for usage of handlers and log levels
37 * @link https://github.com/Seldaek/monolog
38 */
39
40if (!defined("ROOTDIR")) {
41 die("This file cannot be accessed directly");
42}
43
44$handle = new ErrorLogHandler(
45 ErrorLogHandler::OPERATING_SYSTEM,
46 Logger::WARNING
47);
48
49$handle->setFormatter(
50 new LineFormatter(
51 '[%channel%] %level_name%: %message% %context% %extra%'
52 )
53);
54
55Log::pushHandler($handle);
56