https://github.com/jcabi/jcabi-maven-slf4j
SLF4J Binding for Apache Maven
https://github.com/jcabi/jcabi-maven-slf4j
java logging maven slf4j
Last synced: 1 day ago
JSON representation
SLF4J Binding for Apache Maven
- Host: GitHub
- URL: https://github.com/jcabi/jcabi-maven-slf4j
- Owner: jcabi
- License: other
- Created: 2013-09-04T13:27:44.000Z (almost 12 years ago)
- Default Branch: master
- Last Pushed: 2025-06-06T21:35:27.000Z (23 days ago)
- Last Synced: 2025-06-06T22:29:13.808Z (23 days ago)
- Topics: java, logging, maven, slf4j
- Language: Java
- Homepage: https://slf4j.jcabi.com
- Size: 351 KB
- Stars: 14
- Watchers: 5
- Forks: 4
- Open Issues: 12
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
[](https://www.elegantobjects.org)
[](https://www.0crat.com/p/C3RUBL5H9)
[](http://www.rultor.com/p/jcabi/jcabi-maven-slf4j)[](https://github.com/jcabi/jcabi-maven-slf4j/actions/workflows/mvn.yml)
[](http://www.0pdd.com/p?name=jcabi/jcabi-maven-slf4j)
[](https://maven-badges.herokuapp.com/maven-central/com.jcabi/jcabi-maven-slf4j)
[](http://www.javadoc.io/doc/com.jcabi/jcabi-maven-slf4j)
[](https://codecov.io/gh/jcabi/jcabi-maven-slf4j)More details are here: [slf4j.jcabi.com](https://slf4j.jcabi.com/index.html)
Maven Log to SLF4J binding is implemented with
`StaticLoggerBinder` singleton. This is how you use it in your Maven plugin:```java
import com.jcabi.log.Logger;
import org.apache.maven.plugin.AbstractMojo;
import org.slf4j.impl.StaticLoggerBinder;public class MyMojo extends AbstractMojo {
@Override
public void execute() {
StaticLoggerBinder.getSingleton().setMavenLog(this.getLog());
// ... later ...
Logger.info(this, "hello, world!");
// and you can still use the usual logging mechanism
this.getLog().info("hello again");
}
}
```The `Logger.info()` call will go to Maven Log through SLF4J.
## How to contribute?
Fork the repository, make changes, submit a pull request.
We promise to review your changes same day and apply to
the `master` branch, if they look correct.Please run Maven build before submitting a pull request:
```
$ mvn clean install -Pqulice
```