Skip to content

Doclassif/elastic

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

73 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Elastic custom formatter

Latest Stable Version

Запуск в dev container VScode

  1. Open project
  2. F1 -> Dev Containers: Rebuild and Reopen in Container

Запуск тестов (которые будут в обозримом будущем)

composer test
  1. Добавить конфигурацию в config/logging.php (актуальная конфигурация в документации пакета)
     'channels' => [
        'stack' => [
            'driver' => 'stack',
            'channels' => ['stdout', 'daily', 'elasticsearch'],
            'ignore_exceptions' => false,
        ],

         'elasticsearch' => [
            'driver'         => 'monolog',
            'level'          => 'debug',
            'handler'        => Kali\Elastic\ElasticsearchHandler::class,
            'formatter'      => Kali\Elastic\ElasticsearchFormatter::class,
            'formatter_with' => [
                'index' => env('ELASTIC_LOGS_INDEX'),
                'type'  => '_doc',
            ],
            'handler_with'   => [
                'hosts' => [env('ELASTIC_HOST', "http://elasticsearch:9200/")],
                'options' => [
                    'ignore_error' => env('ELASTIC_IGNORE_ERROR', true),
                ]
            ],
        ],
    ],

.env переменные

ELASTIC_HOST=elasticsearch:9200
ELASTIC_LOGS_INDEX=test_logs
  1. Выполнить php artisan vendor:publish и выбрать Elastic\Providers\ElasticServiceProvider

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published