README.md in ougai-0.9.0 vs README.md in ougai-1.0.0
- old
+ new
@@ -166,9 +166,25 @@
end
```
To specify more than one of a message, an exception and custom data, the block returns them as an array.
+### Adding custom fields to all logs
+
+The fields of `with_fields` add to all logs as is.
+
+```ruby
+logger.with_fields = { version: '1.1.0' }
+logger.debug(user: { name: 'Taro', age: 19 })
+logger.info('Hello!', user: { name: 'Jiro' }, version: '2.3')
+```
+
+```json
+{"name":"test","hostname":"mint","pid":30182,"level":20,"time":"2017-07-22T20:52:12.332+09:00","v":0,"version":"1.1.0","msg":"No message","user":{"name":"Taro","age":19}}
+{"name":"test","hostname":"mint","pid":30308,"level":30,"time":"2017-07-22T20:53:54.314+09:00","v":0,"version":"2.3","user":{"name":"Jiro"},"msg":"Hello!"}
+```
+
+If any field of with_fields is specified in each log, the field is overridden.
## View log by node-bunyan
Install [bunyan](https://github.com/trentm/node-bunyan) via NPM