- Install:
- $ composer require rubricate/logger
Extending to class AbstractLogger
Use protected methods:
- getDirFullPath() returning the absolute path of the directory
- getPrefixToFile() with your preferred prefix for the log file
File result
-
~
$
cd /path/to/directory/logs/
-
:/path/to/directory/logs/
$
ls
- dev_2022-09-20.txt
-
:/path/to/directory/logs/
$
vim dev_2022-09-20.txt
Change file extension
- Use static property $ex (available in version 0.4.0)
- Example on line 7: protected static $ex = '.log';
File result with .log extension
-
~
$
cd /path/to/directory/logs/
-
:/path/to/directory/logs/
$
ls
- dev_2023-09-20.log
-
:/path/to/directory/logs/
$
vim dev_2023-09-20.log