Error_Log
Class Log
- Full name:
\BigCommerce\Logging\Error_Log
Constants
Constant | Visibility | Type | Value |
---|---|---|---|
EMERGENCY | public | ’emergency’ | |
ALERT | public | ’alert’ | |
CRITICAL | public | ’critical’ | |
ERROR | public | ’error’ | |
WARNING | public | ’warning’ | |
NOTICE | public | ’notice’ | |
INFO | public | ’info’ | |
DEBUG | public | ’debug’ | |
MAX_SIZE | public | 25 | |
ALLOWED_LOGS | public | [‘debug’, ‘webhooks’, ‘manager’] |
Properties
log
public \Monolog\Logger $log
webhook_log
public $webhook_log
log_path
public string $log_path
log_folder_path
public string $log_folder_path
Methods
__construct
Log constructor.
public __construct(string $log_path, mixed $log_folder_path): mixed
Parameters:
Parameter | Type | Description |
---|---|---|
$log_path | string | File system path to the log file |
$log_folder_path | mixed |
init_log
Set up the import errors log
public init_log(mixed $path = ''): mixed
Parameters:
Parameter | Type | Description |
---|---|---|
$path | mixed |
get_log_data
Get data from log
public get_log_data(): array
truncate_log
Clean log file if it has size more than set in Troubleshooting_Diagnostics::LOG_FILE_SIZE
public truncate_log(): mixed
get_log_size_mb
Get log file size in MB
public get_log_size_mb(mixed $path): float|int
Parameters:
Parameter | Type | Description |
---|---|---|
$path | mixed |
log_product_import_error
Writes a log line into the log file
public log_product_import_error(int $product_id, \BigCommerce\Api\v3\Api\CatalogApi $catalog_api, \Exception $exception): mixed
Parameters:
Parameter | Type | Description |
---|---|---|
$product_id | int | |
$catalog_api | \BigCommerce\Api\v3\Api\CatalogApi | |
$exception | \Exception |
log
public log(mixed $level, mixed $message, mixed $context, mixed $path = ''): mixed
Parameters:
Parameter | Type | Description |
---|---|---|
$level | mixed | |
$message | mixed | |
$context | mixed | |
$path | mixed |
add_log_to_diagnostics
public add_log_to_diagnostics(mixed $diagnostics): mixed
Parameters:
Parameter | Type | Description |
---|---|---|
$diagnostics | mixed |
Automatically generated on 2025-01-21