loguru icon indicating copy to clipboard operation
loguru copied to clipboard

how to save log to elastic

Open qiniuweihe opened this issue 2 years ago • 1 comments

As the title, I want to save log to elastic. How to do it in a good manner.

qiniuweihe avatar Feb 21 '23 03:02 qiniuweihe

Just use a Elastic function as a sink.

logger.add(write_log_to_elastic, format="[{time}] {message}")

I don't know Elastic API.

See also: https://github.com/Delgan/loguru/issues/503

Delgan avatar Feb 22 '23 07:02 Delgan