承接 ramibadrpro/laravel-ecs-logging 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

ramibadrpro/laravel-ecs-logging

最新稳定版本:v2.0.3

Composer 安装命令:

composer require ramibadrpro/laravel-ecs-logging

包简介

Logging Laravel log's into Elasticsearch ECS format.

README 文档

README

This package is a fork of AviationCode\EcsLogging, it tries to fix some bugs.

Installation

You can install the package via composer:

composer require ramibadrpro/laravel-ecs-logging

It's recommended to require jenssegers/agent which will add user agent logging support.

composer require jenssegers/agent

Optionally, you can publish the config file with:

php artisan vendor:publish --provider="AviationCode\EcsLogging\EcsLoggingServiceProvider" --tag="config"

Register log driver in config/logging.php

return [ 'channels' => [ // ... Other channels 'ecs' => [ 'driver' => 'ecs', 'path' => storage_path('logs/ecs/laravel.json'), 'level' => 'debug', 'days' => 14, ], ] ];

If you want to use this driver as the only logging method define LOG_CHANNEL=ecs in your .env or add the ecs channel into your stack driver.

All Log::xxx() calls get logged into json file. This file can be picked up by filebeat which sends it to your logstash or elasticsearch instance.

Configure filebeat

Add the following to your /etc/filebeat/filebeat.yml file

filebeat.inputs: - type: log enabled: true paths: - /path-to-your-laravel-app/storage/logs/ecs/*.json json: message_key: message keys_under_root: true overwrite_keys: true

BUGS :

  • Current bugs within the ecs-logs package :

Typed static property Aviation Code\Ecs Logging\Tracing\Correlate::$id must not be accessed before initialization

This is due to trying to access type hinted properties statically before assigning values to them, this was fixed by initialising them with null values

Fork Changelog :

13/05/2022 : Added the option to disable log file rotation through config file (Use the option disable_rotate)

Credits

License

The MIT License (MIT). Please see License File for more information.

统计信息

  • 总下载量: 9.65k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 0
  • Forks: 3
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-01-04

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固