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: elasticsearch-transport/README.md
+12-6Lines changed: 12 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -187,18 +187,24 @@ Elasticsearch::Client.new(
187
187
188
188
### Logging
189
189
190
-
To log requests and responses to standard output with the default logger (an instance of Ruby's {::Logger} class),
191
-
set the `log` argument:
190
+
To log requests and responses to standard output with the default logger (an instance of Ruby's {::Logger} class), set the `log` argument to true:
192
191
193
192
```ruby
194
-
Elasticsearch::Client.newlog:true
193
+
Elasticsearch::Client.new(log:true)
194
+
```
195
+
196
+
You can also use [ecs-logging](https://github.com/elastic/ecs-logging-ruby). `ecs-logging` is a set of libraries that allows you to 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):
197
+
198
+
```ruby
199
+
logger =EcsLogging::Logger.new($stdout)
200
+
Elasticsearch::Client.new(logger: logger)
195
201
```
196
202
197
203
198
204
To trace requests and responses in the _Curl_ format, set the `trace` argument:
199
205
200
206
```ruby
201
-
Elasticsearch::Client.newtrace:true
207
+
Elasticsearch::Client.new(trace:true)
202
208
```
203
209
204
210
You can customize the default logger or tracer:
@@ -211,7 +217,7 @@ You can customize the default logger or tracer:
0 commit comments