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 app

main.php

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
  • Rubricate
  • © 2015 -