-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathxmlGenerator.php
More file actions
26 lines (23 loc) · 900 Bytes
/
Copy pathxmlGenerator.php
File metadata and controls
26 lines (23 loc) · 900 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
<?php
include __DIR__ ."/vendor/autoload.php";
use App\PriceListGenerator;
use App\Config;
use Monolog\Logger;
use Monolog\Handler\StreamHandler;
try {
define('LOG_FILE', 'xmlGeneratorLog.log');
$config = new Config();
$logger = new Logger('xmlGeneratorLog');
$logger->pushHandler(new StreamHandler($config->logPath . LOG_FILE));
echo "Start create price list. \n";
$logger->info('Start create price list.');
(new PriceListGenerator())->execute();
echo "Create price list success!. \n";
$logger->info('Create price list success!.');
} catch (Throwable $e) {
$logger = new Logger('parser');
$logger->pushHandler(new StreamHandler($config->logPath . LOG_FILE));
$logger->warning($e->getMessage() . " file: " . $e->getFile(). " line: " . $e->getLine());
echo "Error! " . $e->getMessage() . " file: " . $e->getFile(). " line: " . $e->getLine();
}
?>