Skip to content

Commit 34b3b53

Browse files
committed
Remove db log folder check on each request.
1 parent c91777b commit 34b3b53

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

readme.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
This module allows you to log SQL queries (and slow SQL queries) to log file in Laravel framework. It's useful mainly
44
when developing your application to verify whether your queries are valid and to make sure your application doesn't run too many or too slow database queries.
55

6-
### Installation
6+
### Installation:
77

88
1. Run
99
```php
@@ -39,4 +39,8 @@ when developing your application to verify whether your queries are valid and to
3939
DB_LOG_SEPARATE_ARTISAN=false
4040
```
4141

42-
and adjust values to your needs. If you have also `.env.sample` it's also recommended to add those entries also in `.env.sample` file just to make sure everyone know about those env variables. Be aware that `DB_LOG_DIRECTORY` is directory inside storage directory. If you want you can change it editing `config/dblogger.php` file.
42+
and adjust values to your needs. If you have also `.env.sample` it's also recommended to add those entries also in `.env.sample` file just to make sure everyone know about those env variables. Be aware that `DB_LOG_DIRECTORY` is directory inside storage directory. If you want you can change it editing `config/dblogger.php` file.
43+
44+
---
45+
#### Note:
46+
> Make sure defined `DB_LOG_DIRECTORY` directory should be exists default direcotry is `\storage\logs\db\` else application will throw error.

src/DbLogger.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -139,10 +139,6 @@ protected function save($data, $execTime, $queryNr)
139139
*/
140140
protected function saveLog($data, $fileName, $override = false)
141141
{
142-
if (!file_exists($this->directory)) {
143-
mkdir($this->directory, 0777, true);
144-
}
145-
146142
file_put_contents($this->directory . DIRECTORY_SEPARATOR . $fileName,
147143
$data, $override ? 0 : FILE_APPEND);
148144
}

0 commit comments

Comments
 (0)