fluent / fluent/fluent-logger-python

Feature Request: Allow relativeCreated to be formatted as seconds instead of milliseconds

Đang mở
#195 1 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
Python
Star
457
Fork
138
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

Python LogRecord has the attribute[ `relativeCreated`](https://docs.python.org/3/library/logging.html#logrecord-attributes)

> Time in milliseconds when the LogRecord was created, relative to the time the logging module was loaded.

It's currently possible to use FluentRecordFormatter to include that in the fluent events

```
version: 1
formatters:
fluent_fmt:
'()': fluent.handler.FluentRecordFormatter
format:
"host.hostname": '%(hostname)s'
"host.id": '%(hostname)s'
"host.uptime": '%(relativeCreated)d'
"log.logger": '%(name)s'
"log.level": '%(levelname)s'
"log.origin.file.name": '%(pathname)s'
"log.origin.file.line": '%(lineno)d'
"log.origin.function": '%(funcName)s'
```

but relativeCreated is in milliseconds, it would be very convenient to be able to convert that to seconds right in FluentRecordFormatter hence this feature request, please considering allowing something like

```
"host.uptime": '%(relativeCreatedInSeconds)d'
```

were the `relativeCreatedInSeconds` would be something added by FluentRecordFormatter.

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.