简体   繁体   English

Log4j / Slf4j记录到BigQuery

[英]Log4j / Slf4j Logging to BigQuery

I use Log4J in a Java project and would like to asynchronously stream my logs to BigQuery. 我在Java项目中使用Log4J,并希望将日志异步流式传输到BigQuery。 I did some research but couldn't really find a good way to do this. 我做了一些研究,但找不到真正的好方法。 Even though, I think many people do this (I know some that do it for different languages). 即使,我认为很多人都这样做(我知道有些人针对不同的语言也这样做)。

Mind you, I found some several years old unmaintained code, but nothing that seems to maintained and that I would consider using in a production project. 提醒您,我发现了一些没有维护的旧代码,但是似乎没有任何维护的代码,并且考虑在生产项目中使用。 Also the asynchronous part is very important for me, it should be non-blocking. 异步部分对我来说也很重要,它应该是非阻塞的。

Is there a library or some best practices to do this properly? 是否有图书馆或一些最佳实践来正确地做到这一点?

One solution would be to use the Java client library for Stackdriver Logging . 一种解决方案是将Java客户端库用于Stackdriver Logging You can then export your logs to BigQuery . 然后,您可以将日志导出BigQuery

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM