ClassesBigCommerceLoggingError Log

Error_Log

Class Log

  • Full name: \BigCommerce\Logging\Error_Log

Constants

ConstantVisibilityTypeValue
EMERGENCYpublic’emergency’
ALERTpublic’alert’
CRITICALpublic’critical’
ERRORpublic’error’
WARNINGpublic’warning’
NOTICEpublic’notice’
INFOpublic’info’
DEBUGpublic’debug’
MAX_SIZEpublic25
ALLOWED_LOGSpublic[‘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:

ParameterTypeDescription
$log_pathstringFile system path to the log file
$log_folder_pathmixed

init_log

Set up the import errors log

public init_log(mixed $path = ''): mixed

Parameters:

ParameterTypeDescription
$pathmixed

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:

ParameterTypeDescription
$pathmixed

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:

ParameterTypeDescription
$product_idint
$catalog_api\BigCommerce\Api\v3\Api\CatalogApi
$exception\Exception

log

public log(mixed $level, mixed $message, mixed $context, mixed $path = ''): mixed

Parameters:

ParameterTypeDescription
$levelmixed
$messagemixed
$contextmixed
$pathmixed

add_log_to_diagnostics

public add_log_to_diagnostics(mixed $diagnostics): mixed

Parameters:

ParameterTypeDescription
$diagnosticsmixed


Automatically generated on 2025-01-21