PHP code example of virtua / shopware-app-logger-bundle
1. Go to this page and download the library: Download virtua/shopware-app-logger-bundle library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
virtua / shopware-app-logger-bundle example snippets
Virtua\ShopwareAppLoggerBundle\VirtuaShopwareAppLoggerBundle::class => ['all' => true]
use Virtua\ShopwareAppLoggerBundle\Service\Logger;
use Virtua\ShopwareAppLoggerBundle\Util\LoggerData;
/* ... */
public function __construct(Logger $logger)
{
$this->logger = $logger;
}
/* ... */
public function exampleFunction(): void
{
$loggerData = new LoggerData($shopId);
$loggerData->setErrorMessage("Your error message");
$loggerData->setErrorCode(404); //This is optional, default code is 400
$this->logger->log($loggerData);
}