You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+11-19Lines changed: 11 additions & 19 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,36 +3,28 @@
3
3
Transform your application logs to structured logs that comply with the [Elastic Common Schema (ECS)](https://www.elastic.co/guide/en/ecs/current/ecs-reference.html).
4
4
In combination with [filebeat](https://www.elastic.co/products/beats/filebeat) you can send your logs directly to Elasticsearch and leverage [Kibana's Logs UI](https://www.elastic.co/guide/en/infrastructure/guide/current/logs-ui-overview.html) to inspect all logs in one single place.
5
5
This library allows you to provide more observability for your PHP applications as can e.g. corrolate your logs with e.g. APM traces.
6
+
See [ecs-logging](https://github.com/elastic/ecs-logging) for other ECS logging libraries and more resources about ECS & logging.
6
7
7
-
## Usage
8
-
9
-
Please note that the major version of this library is compatible with the major version of ECS.
10
-
11
-
### Install
12
-
8
+
## Install
13
9
```
14
10
composer require elastic/ecs-logging-php
15
11
```
16
12
17
-
### Monolog Formater
18
-
```php
19
-
use Monolog\Logger;
20
-
use Monolog\Handler\StreamHandler;
21
-
use Elastic\Monolog\Formatter\ElasticCommonSchemaFormatter;
22
-
23
-
$logger = new Logger('my_ecs_logger');
24
-
$formatter = new ElasticCommonSchemaFormatter();
25
-
$handler = new StreamHandler('<path-to-log-dir>/application.json', Logger::INFO);
0 commit comments