You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

107 lines
3.8 KiB

4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
  1. <?php
  2. use Monolog\Handler\AmqpHandler;
  3. use PhpAmqpLib\Channel\AMQPChannel;
  4. use App\HiLib\Logger\CreateCustomLogger;
  5. use PhpAmqpLib\Connection\AMQPStreamConnection;
  6. return [
  7. 'default' => env('LOG_CHANNEL', 'stack'),
  8. 'channels' => [
  9. 'hi' => [
  10. 'driver' => 'custom',
  11. 'via' => CreateCustomLogger::class,
  12. 'handler' => AmqpHandler::class,
  13. 'with' => [
  14. 'exchange' => new AMQPChannel(
  15. new AMQPStreamConnection("liwo_rabbitmq_1", 5672, 'root', 'root')
  16. ),
  17. 'exchangeName' => 'log_exchange'
  18. ],
  19. ],
  20. 'stack' => [
  21. 'driver' => 'stack',
  22. 'channels' => ['hi', 'daily',],
  23. 'ignore_exceptions' => false,
  24. ],
  25. 'single' => [
  26. 'driver' => 'single',
  27. 'path' => storage_path('logs/laravel.log'),
  28. 'level' => 'debug',
  29. ],
  30. 'daily' => [
  31. 'driver' => 'daily',
  32. 'path' => storage_path('logs/laravel.log'),
  33. 'level' => 'debug',
  34. 'days' => 14,
  35. ],
  36. 'gelf' => [
  37. 'driver' => 'custom',
  38. 'via' => \Hedii\LaravelGelfLogger\GelfLoggerFactory::class,
  39. // This optional option determines the processors that should be
  40. // pushed to the handler. This option is useful to modify a field
  41. // in the log context (see NullStringProcessor), or to add extra
  42. // data. Each processor must be a callable or an object with an
  43. // __invoke method: see monolog documentation about processors.
  44. // Default is an empty array.
  45. 'processors' => [
  46. \Hedii\LaravelGelfLogger\Processors\NullStringProcessor::class,
  47. // another processor...
  48. ],
  49. // This optional option determines the minimum "level" a message
  50. // must be in order to be logged by the channel. Default is 'debug'
  51. 'level' => 'debug',
  52. // This optional option determines the channel name sent with the
  53. // message in the 'facility' field. Default is equal to app.env
  54. // configuration value
  55. 'name' => 'my-custom-name',
  56. // This optional option determines the system name sent with the
  57. // message in the 'source' field. When forgotten or set to null,
  58. // the current hostname is used.
  59. 'system_name' => null,
  60. // This optional option determines if you want the UDP, TCP or HTTP
  61. // transport for the gelf log messages. Default is UDP
  62. 'transport' => 'udp',
  63. // This optional option determines the host that will receive the
  64. // gelf log messages. Default is 127.0.0.1
  65. 'host' => 'graylog',
  66. // This optional option determines the port on which the gelf
  67. // receiver host is listening. Default is 12201
  68. 'port' => 12201,
  69. // This optional option determines the path used for the HTTP
  70. // transport. When forgotten or set to null, default path '/gelf'
  71. // is used.
  72. 'path' => null,
  73. // This optional option determines the maximum length per message
  74. // field. When forgotten or set to null, the default value of
  75. // \Monolog\Formatter\GelfMessageFormatter::DEFAULT_MAX_LENGTH is
  76. // used (currently this value is 32766)
  77. 'max_length' => null,
  78. // This optional option determines the prefix for 'context' fields
  79. // from the Monolog record. Default is null (no context prefix)
  80. 'context_prefix' => null,
  81. // This optional option determines the prefix for 'extra' fields
  82. // from the Monolog record. Default is null (no extra prefix)
  83. 'extra_prefix' => null,
  84. ],
  85. ],
  86. ];