-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #31 from JohnRoux/feature/driver-update
Logger Update 1) Custom Log Driver Update
- Loading branch information
Showing
4 changed files
with
72 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,45 @@ | ||
<?php | ||
|
||
return [ | ||
//currently supported drivers are 'db' and 'file' | ||
"driver" => "file", | ||
"filename" => "api-{Y-m-d}.log", | ||
"dont_log" => [ | ||
|
||
/* | ||
|-------------------------------------------------------------------------- | ||
| Log Storage Driver | ||
|-------------------------------------------------------------------------- | ||
| | ||
| This determines how the logs are stored. | ||
| Currently supported drivers are 'db' and 'file' | ||
| If you want to use your own custom driver, you can parse through your | ||
| Class name here: Eg: `\App\Apilogs\CustomLogger::class` | ||
| Note: your log driver MUST implement ApiLoggerInterface! | ||
| | ||
*/ | ||
|
||
'driver' => env('API_LOGS_DRIVER', 'file'), | ||
|
||
|
||
/* | ||
|-------------------------------------------------------------------------- | ||
| Filename Format | ||
|-------------------------------------------------------------------------- | ||
| | ||
| The name and format of the log files which are created. | ||
| Only applicable if the 'file' driver is being used | ||
| | ||
*/ | ||
|
||
'filename' => env('API_LOGS_FILENAME_FORMAT', 'api-{Y-m-d}.log'), | ||
|
||
|
||
/* | ||
|-------------------------------------------------------------------------- | ||
| Request Exclusions | ||
|-------------------------------------------------------------------------- | ||
| | ||
| This sets which request data is excluded from the logging | ||
| | ||
*/ | ||
'dont_log' => [ | ||
'password', 'password_confirmation', 'new_password', 'old_password', | ||
] | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<?php | ||
|
||
namespace AWT\Http\Exceptions; | ||
|
||
use Exception; | ||
use Throwable; | ||
|
||
class InvalidApiLogDriverException extends Exception | ||
{ | ||
public function __construct( | ||
$message = 'Invalid Api Log Driver', | ||
$code = 0, | ||
Throwable $previous = null | ||
) { | ||
parent::__construct($message, $code, $previous); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters