适用于Maven记录器的SLFJ4桥 [英] SLFJ4 bridge for the Maven logger

查看:61
本文介绍了适用于Maven记录器的SLFJ4桥的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在编写Maven 3.x插件,并希望使用SLF4J&重新登录.

I'm writing a Maven 3.x plugin and want to log with SLF4J & Logback.

我为Maven Logger找到了一些SLF4J绑定:

I found some SLF4J bindings for the Maven Logger:

但是,这些似乎是SLF4J绑定,但我认为我需要的是Maven Logger的桥梁,即,将所有Maven日志语句桥接/路由到SLF4J,并使用LogBack绑定和logback.xml配置.

However, these seem to be SLF4J bindings but I believe what I need is a bridge for the Maven Logger i.e. to bridge/route all Maven log statements to SLF4J and use LogBack binding with logback.xml config.

推荐答案

从Maven 3.1开始,您可以直接从Maven插件使用SLF4J:

You can use SLF4J directly from Maven plugin since Maven 3.1:

从Maven 3.1.0开始的标准Maven发行版使用与SLF4J Simple实现结合使用的SLF4J API日志记录.将来的版本可能会使用更高级的实现,但我们选择了从简单开始.

The standard Maven distribution, from Maven 3.1.0 onward, uses the SLF4J API for logging combined with the SLF4J Simple implementation. Future versions may use a more advanced implementation, but we chose to start simple.

不需要桥接,绑定等.

来源: https://maven.apache.org/maven-logging.html

这篇关于适用于Maven记录器的SLFJ4桥的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆