travelnoord/laravel-ecs-logging

A Laravel package for performing logging in an Elastic-compatible format.

0.1.0 2025-03-17 09:41 UTC

This package is auto-updated.

Last update: 2025-05-31 00:23:51 UTC


README

This package implements Elastic ECS logging.

Installation

To install this package, define the repository in your composer.json file, for example:

composer require travelnoord/laravel-ecs-logging

Configuration

TBD

Only filter out the log message

TBD

Usage

Filter Secrets

To filter out secrets or other private information call the log filter:

\Ecs::secret('my-secret-password');

or

\Travelnoord\Logging\Facades\Ecs::secret('my-secret-password');

You can also pass an array with credentials:

\Ecs::filter([
    'api-key-1',
    'api-key-2',
])

Log Context

TBD

Development

Several checkers are available by default if this package is installed with dev-dependencies enabled.

Composer Checks

To run all the checks:

composer ci

To run all static checks:

composer lint

To run only tests:

composer test

PHPUnit

You can run PHPUnit by simply running vendor/bin/phpunit in the directory the package is installed in. It will automatically detect the phpunit configuration file for the project, and detect which directory it should run in.

PHPStan

You can run PHPStan by simply running vendor/bin/phpstan in the directory the package is installed in. It will automatically detect the phpstan configuration file for the project, and detect which directory it should run in.

PHPCS

You may run PHPCS by running vendor/bin/phpcs src/ in the directory the package is installed in. It will use the phpcs.xml file defined in the project root directory to determine which coding standards to use.