Magento Extensions Rating 2024
EXTENSIONS BY CATEGORY
B2B (Business-To-Business)
Blog
Customer
ERP (Enterprise Resource Planning)
Mega Menu
One Step Checkout
Order
POS (Point Of Sale)
Search
Shopping Cart
Sitemap
SEO
Social
Stock & Inventory Management
EXTENSIONS BY DEVELOPER
aheadWorks
Amasty
Boost My Shop
BSS Commerce
Magestore
MageWorx
Mirasvit
Templates Master
Wyomind
XTENTO
Magento 2 Documentation
Magento 2 Documentation
2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
vendor
magento
framework
DB
Logger
File.php
Go to the documentation of this file.
1
<?php
6
namespace
Magento\Framework\DB\Logger
;
7
8
use
Magento\Framework\App\Filesystem\DirectoryList
;
9
use
Magento\Framework\Filesystem
;
10
use
Magento\Framework\Filesystem\Directory\WriteInterface
;
11
15
class
File
extends
LoggerAbstract
16
{
20
private
$dir;
21
27
protected
$debugFile
;
28
36
public
function
__construct
(
37
Filesystem
$filesystem
,
38
$debugFile
=
'debug/db.log'
,
39
$logAllQueries =
false
,
40
$logQueryTime = 0.05,
41
$logCallStack =
false
42
) {
43
parent::__construct($logAllQueries, $logQueryTime, $logCallStack);
44
$this->dir =
$filesystem
->getDirectoryWrite(
DirectoryList::VAR_DIR
);
45
$this->debugFile =
$debugFile
;
46
}
47
51
public
function
log
($str)
52
{
53
$str =
'## '
. date(
'Y-m-d H:i:s'
) .
"\r\n"
. $str;
54
55
$stream = $this->dir->openFile($this->debugFile,
'a'
);
56
$stream->lock();
57
$stream->write($str);
58
$stream->unlock();
59
$stream->close();
60
}
61
65
public
function
logStats
(
$type
, $sql, $bind = [],
$result
=
null
)
66
{
67
$stats = $this->
getStats
(
$type
, $sql, $bind,
$result
);
68
if
($stats) {
69
$this->
log
($stats);
70
}
71
}
72
76
public
function
critical
(\Exception $e)
77
{
78
$this->
log
(
"EXCEPTION \n$e\n\n"
);
79
}
80
}
$result
$result
Definition:
product_configurable_not_available_rollback.php:26
Magento\Framework\Filesystem
Definition:
Filesystem.php:16
Magento\Framework\DB\Logger\File\critical
critical(\Exception $e)
Definition:
File.php:76
Magento\Framework\DB\Logger
Definition:
File.php:6
Magento\Framework\Filesystem
Magento\Framework\App\Filesystem\DirectoryList\VAR_DIR
const VAR_DIR
Definition:
DirectoryList.php:58
Magento\Framework\DB\Logger\File
Definition:
File.php:15
Magento\Framework\Filesystem\Directory\WriteInterface
Definition:
WriteInterface.php:12
$type
$type
Definition:
item.phtml:13
Magento\Framework\DB\Logger\File\log
log($str)
Definition:
File.php:51
Magento\Framework\DB\Logger\LoggerAbstract\getStats
getStats($type, $sql, $bind=[], $result=null)
Definition:
LoggerAbstract.php:63
Magento\Framework\App\Filesystem\DirectoryList
Definition:
DirectoryList.php:13
Magento\Framework\DB\Logger\File\$debugFile
$debugFile
Definition:
File.php:27
Magento\Framework\DB\Logger\File\logStats
logStats($type, $sql, $bind=[], $result=null)
Definition:
File.php:65
Magento\Framework\DB\Logger\LoggerAbstract
Definition:
LoggerAbstract.php:11
Magento\Framework\DB\Logger\File\__construct
__construct(Filesystem $filesystem, $debugFile='debug/db.log', $logAllQueries=false, $logQueryTime=0.05, $logCallStack=false)
Definition:
File.php:36
$filesystem
$filesystem
Definition:
validate_image.php:10