Skip to content

Commit 2e6e731

Browse files
authored
Lejo/helper for ecs context (#53)
* Helper for ecs context * Helper for ecs context * Update workflows
1 parent fdb0cbf commit 2e6e731

10 files changed

Lines changed: 3649 additions & 9 deletions

.github/workflows/quality-assurance.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
runs-on: ubuntu-latest
1515
strategy:
1616
matrix:
17-
php-version: [8.1]
17+
php-version: [8.3]
1818
steps:
1919
- uses: actions/checkout@v5
2020
- uses: shivammathur/setup-php@v2
@@ -27,7 +27,7 @@ jobs:
2727
runs-on: ubuntu-latest
2828
strategy:
2929
matrix:
30-
php-version: [8.1, 8.2]
30+
php-version: [8.3, 8.4]
3131
steps:
3232
- uses: actions/checkout@v5
3333
- uses: shivammathur/setup-php@v2

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,3 @@
22
/vendor/
33
.php_cs.cache
44
*.cache
5-
composer.lock

README.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,18 @@
11
# FilebeatLogger
2-
#### Install via composer
2+
## Install via composer
33
```
44
composer require cego/filebeat-logger
5+
```
6+
7+
## Helper for creating ECS compliant log context
8+
```php
9+
Log::error('Error message', ECS::create()
10+
->withThrowable($exception)
11+
->withEvent(
12+
action: 'create-user',
13+
category: [],
14+
dataset: 'user-service.registration',
15+
outcome: 'success',
16+
id: '12345',
17+
);
18+
```

composer.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,16 @@
88
"require": {
99
"php": "8.x.x",
1010
"monolog/monolog": "3.x.x",
11-
"ua-parser/uap-php": "3.x.x"
11+
"ua-parser/uap-php": "3.x.x",
12+
"nesbot/carbon": "^3.9"
1213
},
1314
"autoload": {
1415
"psr-4": {
1516
"Cego\\": "src/"
1617
}
1718
},
1819
"require-dev": {
19-
"cego/php-cs-fixer": "2.x",
20-
"phpstan/phpstan": "1.x.x"
20+
"cego/php-cs-fixer": "^2",
21+
"phpstan/phpstan": "^2"
2122
}
2223
}

0 commit comments

Comments
 (0)