dblogger.php 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. <?php
  2. /*
  3. * This file is part of ibrand/laravel-database-logger.
  4. *
  5. * (c) 果酱社区 <https://guojiang.club>
  6. *
  7. * For the full copyright and license information, please view the LICENSE
  8. * file that was distributed with this source code.
  9. */
  10. return [
  11. /*
  12. * Which guard need ot record the exec of the query.
  13. * null: all guard.
  14. * array: from config('auth.guards'), ['web','api']
  15. * ['web'=>['select','update','delete from','insert into']]
  16. */
  17. 'guards' => null,
  18. /*
  19. * All Database queries should be logged
  20. */
  21. 'log_queries' => env('DB_LOG_QUERIES', false),
  22. /*
  23. * Whether artisan queries should be logged to separate files
  24. */
  25. 'log_console_to_separate_file' => env('DB_LOG_SEPARATE_ARTISAN', false),
  26. /*
  27. * Whether slow DB queries should be logged (you can log all queries and
  28. * also slow queries in separate file or you might to want log only slow
  29. * queries)
  30. */
  31. 'log_slow_queries' => env('DB_LOG_SLOW_QUERIES', true),
  32. /*
  33. * Time of query (in milliseconds) when this query is considered as slow
  34. */
  35. 'slow_queries_min_exec_time' => env('DB_SLOW_QUERIES_MIN_EXEC_TIME', 100),
  36. /*
  37. * Whether log (for all queries, not for slow queries) should be overridden.
  38. * It might be useful when you test some functionality and you want to
  39. * compare your queries (or number of queries) - be aware that when using
  40. * AJAX it will override your log file in each request
  41. */
  42. 'override_log' => env('DB_LOG_OVERRIDE', false),
  43. /*
  44. * Directory where log files will be saved
  45. */
  46. 'directory' => storage_path(env('DB_LOG_DIRECTORY', 'logs/db')),
  47. /*
  48. * Whether execution time in log file should be displayed in seconds
  49. * (by default it's in milliseconds)
  50. */
  51. 'convert_to_seconds' => env('DB_CONVERT_TIME_TO_SECONDS', false),
  52. ];