mirror of
https://github.com/opensourcepos/opensourcepos.git
synced 2026-04-17 13:31:07 -04:00
- Merge Config and Core File Changes 4.6.3 > 4.6.4 - Merge Config and Core File Changes 4.6.4 > 4.7.0 - Added app\Config\WorkerMode.php - Merge Config and Core File Changes Not previously merged - Added app\Config\Hostnames.php - Corrected incorrect CSS property used in invoice.php view. - Corrected unknown CSS properties used in register.php view. - Used shorthand CSS in debug.css - Corrected indentation in barcode_sheet.php view. - Corrected indentation in footer.php view. - Corrected indentation in invoice_email.php view. - Replaced obsolete attributes with CSS style attributes in barcode_sheet.php - Replaced obsolete attribute in error_exception.php - Replaced obsolete attribute in invoice_email.php - Replaced obsolete attribute in quote_email.php - Replaced obsolete attributes in work_order_email.php - Fixed indentation in system_info.php - Replaced <strong> tag outside <p> tags, which isn't allowed, with style attributes. - Simplified js return logic and indentation fixes in tax_categories.php - Simplified js return logic in tax_codes.php - Simplified js return logic in tax_jurisdictions.php - Removed unnecessary labels in manage views. - Rewrite JavaScript function and PHP to be more readable in bar.php, hbar.php, line.php and pie.php - Added type declarations, return types and an import to app\Config\Services - Updated Attribute.php parameter type - Updated Receiving_lib.php parameter type - Updated Receivings.php parameter types and updated PHPdocs - Updated tabular_helper.php parameter types and updated PHPdocs - Added type declarations and corrected PHPdocs in url_helper.php - Added return types to functions - Revert $objectSrc value in ContentSecurityPolicy.php - Correct return type in Customer->get_stats() - Correct return type in Item->get_info_by_id_or_number() - Correct misspelling in border-spacing - Added missing css style semicolons - Resolve operator precedence ambiguity. - Resolve column mismatch. - Added missing escaping in view. - Updated requirement for PHP 8.2 - Resolve unresolved conflicts - Added PHP 8.2 requirement to the README.md - Fixed bugs in display of UI - Fixed duplicated `>` in app\Views\Expenses\manage.php - Removed excess whitespace at the end of some lines in table_filter_persistence.php - Added missing `>` in app\Views\Expenses\manage.php - Corrected grammar in PHPdoc in table_filter_persistence.php - Remove bug causing `\` to be injected into the new giftcard value - Fix bug causing DROPDOWN Attribute Values to not save correctly - Added check for null in $normalizedItemId - Removing < PHP 8.2 from linting and tests - Update Linter to not include PHP 8.2 and 8.1 - Remove PHP 8.1 unit test cycle. - Update Bug Report Template - Update Composer files for CodeIgniter 4.7.2 - Updated INSTALL.md to reflect changes. --------- Signed-off-by: objec <objecttothis@gmail.com>
152 lines
5.9 KiB
PHP
152 lines
5.9 KiB
PHP
<?php
|
|
|
|
namespace Config;
|
|
|
|
use CodeIgniter\Config\BaseConfig;
|
|
use CodeIgniter\Log\Handlers\FileHandler;
|
|
use CodeIgniter\Log\Handlers\HandlerInterface;
|
|
|
|
class Logger extends BaseConfig
|
|
{
|
|
/**
|
|
* --------------------------------------------------------------------------
|
|
* Error Logging Threshold
|
|
* --------------------------------------------------------------------------
|
|
*
|
|
* You can enable error logging by setting a threshold over zero. The
|
|
* threshold determines what gets logged. Any values below or equal to the
|
|
* threshold will be logged.
|
|
*
|
|
* Threshold options are:
|
|
*
|
|
* - 0 = Disables logging, Error logging TURNED OFF
|
|
* - 1 = Emergency Messages - System is unusable
|
|
* - 2 = Alert Messages - Action Must Be Taken Immediately
|
|
* - 3 = Critical Messages - Application component unavailable, unexpected exception.
|
|
* - 4 = Runtime Errors - Don't need immediate action, but should be monitored.
|
|
* - 5 = Warnings - Exceptional occurrences that are not errors.
|
|
* - 6 = Notices - Normal but significant events.
|
|
* - 7 = Info - Interesting events, like user logging in, etc.
|
|
* - 8 = Debug - Detailed debug information.
|
|
* - 9 = All Messages
|
|
*
|
|
* You can also pass an array with threshold levels to show individual error types
|
|
*
|
|
* array(1, 2, 3, 8) = Emergency, Alert, Critical, and Debug messages
|
|
*
|
|
* For a live site you'll usually enable Critical or higher (3) to be logged otherwise
|
|
* your log files will fill up very fast.
|
|
*
|
|
* @var int|list<int>
|
|
*/
|
|
public $threshold = (ENVIRONMENT === 'production') ? 4 : 9;
|
|
|
|
/**
|
|
* --------------------------------------------------------------------------
|
|
* Date Format for Logs
|
|
* --------------------------------------------------------------------------
|
|
*
|
|
* Each item that is logged has an associated date. You can use PHP date
|
|
* codes to set your own date formatting
|
|
*/
|
|
public string $dateFormat = 'Y-m-d H:i:s';
|
|
|
|
/**
|
|
* --------------------------------------------------------------------------
|
|
* Log Handlers
|
|
* --------------------------------------------------------------------------
|
|
*
|
|
* The logging system supports multiple actions to be taken when something
|
|
* is logged. This is done by allowing for multiple Handlers, special classes
|
|
* designed to write the log to their chosen destinations, whether that is
|
|
* a file on the getServer, a cloud-based service, or even taking actions such
|
|
* as emailing the dev team.
|
|
*
|
|
* Each handler is defined by the class name used for that handler, and it
|
|
* MUST implement the `CodeIgniter\Log\Handlers\HandlerInterface` interface.
|
|
*
|
|
* The value of each key is an array of configuration items that are sent
|
|
* to the constructor of each handler. The only required configuration item
|
|
* is the 'handles' element, which must be an array of integer log levels.
|
|
* This is most easily handled by using the constants defined in the
|
|
* `Psr\Log\LogLevel` class.
|
|
*
|
|
* Handlers are executed in the order defined in this array, starting with
|
|
* the handler on top and continuing down.
|
|
*
|
|
* @var array<class-string<HandlerInterface>, array<string, int|list<string>|string>>
|
|
*/
|
|
public array $handlers = [
|
|
/*
|
|
* --------------------------------------------------------------------
|
|
* File Handler
|
|
* --------------------------------------------------------------------
|
|
*/
|
|
FileHandler::class => [
|
|
// The log levels that this handler will handle.
|
|
'handles' => [
|
|
'critical',
|
|
'alert',
|
|
'emergency',
|
|
'debug',
|
|
'error',
|
|
'info',
|
|
'notice',
|
|
'warning',
|
|
],
|
|
|
|
/*
|
|
* The default filename extension for log files.
|
|
* An extension of 'php' allows for protecting the log files via basic
|
|
* scripting, when they are to be stored under a publicly accessible directory.
|
|
*
|
|
* NOTE: Leaving it blank will default to 'log'.
|
|
*/
|
|
'fileExtension' => '',
|
|
|
|
/*
|
|
* The file system permissions to be applied on newly created log files.
|
|
*
|
|
* IMPORTANT: This MUST be an integer (no quotes) and you MUST use octal
|
|
* integer notation (i.e. 0700, 0644, etc.)
|
|
*/
|
|
'filePermissions' => 0660,
|
|
|
|
/*
|
|
* Logging Directory Path
|
|
*
|
|
* By default, logs are written to WRITEPATH . 'logs/'
|
|
* Specify a different destination here, if desired.
|
|
*/
|
|
'path' => '',
|
|
],
|
|
|
|
/*
|
|
* The ChromeLoggerHandler requires the use of the Chrome web browser
|
|
* and the ChromeLogger extension. Uncomment this block to use it.
|
|
*/
|
|
// 'CodeIgniter\Log\Handlers\ChromeLoggerHandler' => [
|
|
// /*
|
|
// * The log levels that this handler will handle.
|
|
// */
|
|
// 'handles' => ['critical', 'alert', 'emergency', 'debug',
|
|
// 'error', 'info', 'notice', 'warning'],
|
|
// ],
|
|
|
|
/*
|
|
* The ErrorlogHandler writes the logs to PHP's native `error_log()` function.
|
|
* Uncomment this block to use it.
|
|
*/
|
|
// 'CodeIgniter\Log\Handlers\ErrorlogHandler' => [
|
|
// /* The log levels this handler can handle. */
|
|
// 'handles' => ['critical', 'alert', 'emergency', 'debug', 'error', 'info', 'notice', 'warning'],
|
|
//
|
|
// /*
|
|
// * The message type where the error should go. Can be 0 or 4, or use the
|
|
// * class constants: `ErrorlogHandler::TYPE_OS` (0) or `ErrorlogHandler::TYPE_SAPI` (4)
|
|
// */
|
|
// 'messageType' => 0,
|
|
// ],
|
|
];
|
|
}
|