logging.php 2.6 KB

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