logging.php 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. <?php
  2. use Monolog\Handler\StreamHandler;
  3. return [
  4. /*
  5. |--------------------------------------------------------------------------
  6. | Default Log Channel
  7. |--------------------------------------------------------------------------
  8. |
  9. | This option defines the default log channel that gets used when writing
  10. | messages to the logs. The name specified in this option should match
  11. | one of the channels defined in the "channels" configuration array.
  12. |
  13. */
  14. 'default' => env('LOG_CHANNEL', 'stack'),
  15. /*
  16. |--------------------------------------------------------------------------
  17. | Log Channels
  18. |--------------------------------------------------------------------------
  19. |
  20. | Here you may configure the log channels for your application. Out of
  21. | the box, Laravel uses the Monolog PHP logging library. This gives
  22. | you a variety of powerful log handlers / formatters to utilize.
  23. |
  24. | Available Drivers: "single", "daily", "slack", "syslog",
  25. | "errorlog", "custom", "stack"
  26. |
  27. */
  28. 'channels' => [
  29. 'stack' => [
  30. 'driver' => 'stack',
  31. 'channels' => ['single'],
  32. ],
  33. 'single' => [
  34. 'driver' => 'single',
  35. 'path' => storage_path('logs/laravel.log'),
  36. 'level' => 'debug',
  37. ],
  38. 'daily' => [
  39. 'driver' => 'daily',
  40. 'path' => storage_path('logs/laravel.log'),
  41. 'level' => 'debug',
  42. 'days' => 7,
  43. ],
  44. 'slack' => [
  45. 'driver' => 'slack',
  46. 'url' => env('LOG_SLACK_WEBHOOK_URL'),
  47. 'username' => 'Laravel Log',
  48. 'emoji' => ':boom:',
  49. 'level' => 'critical',
  50. ],
  51. 'stderr' => [
  52. 'driver' => 'monolog',
  53. 'handler' => StreamHandler::class,
  54. 'with' => [
  55. 'stream' => 'php://stderr',
  56. ],
  57. ],
  58. 'syslog' => [
  59. 'driver' => 'syslog',
  60. 'level' => 'debug',
  61. ],
  62. 'errorlog' => [
  63. 'driver' => 'errorlog',
  64. 'level' => 'debug',
  65. ],
  66. ],
  67. ];