Skip to content


Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?

Latest commit


Git stats


Failed to load latest commit information.
Latest commit message
Commit time

Nuun-log-plugin Build statusMaven Central

This Nuun plugin provides an easy way to inject SLF4J loggers, or to create your own logger annotation.

How to use it

Add the dependency to your pom.xml:


Then, directly use it in your project.

public class MyClass {

    private Logger logger;


How to create my own logger annotation

Our if you are building a framework and you don't want your user to directly dependend on Nuun API, you can create your own logger annotation as follows:

public @interface AnnoCustomLog {

This annotation can now be used in the same way as the NuunLog annotation.

public class MyClass {

    private Logger logger;


Frequent questions

Should Logger members of a class be declared as static?

There is no global response. SLF4J doesn't recommand any of the solution.

We used to recommend that loggers members be declared as instance variables instead of static. After further analysis, we no longer recommend one approach over the other.

If you want more detail about when use static field or instance field see the SLF4J documentation on the subject.

Here is the pros and cons of using instance over static field (Taken from the above page).

Advantages for declaring loggers as instance variables

Possible to take advantage of repository selectors even for libraries shared between applications. However, repository selectors only work if the underlying logging system is logback-classic. Repository selectors do not work for the SLF4J+log4j combination. IOC-friendly

Disadvantages for declaring loggers as instance variables

Less common idiom than declaring loggers as static variables higher CPU overhead: loggers are retrieved and assigned for each instance of the hosting class higher memory overhead: logger declaration will consume one reference per instance of the hosting class


Nuun IO Log Plugin







No packages published