[slf4j-user] Best practice on declaring Loggers

Boris Unckel boris.unckel.mlg at gmx.net
Tue Jun 13 15:25:15 CEST 2006


Hi,


>-------- Original-Nachricht --------
>Datum: Tue, 13 Jun 2006 11:30:47 +0100
>Von: Konstantinos Karadamoglou <kkarad at googlemail.com>
> Which is the best practice of declaring Loggers? For instance, should 
> they  be static, private, final? and why?
this depends on the environment:
For shared classes in server environments a "private final" is useful.
For non-shared classes or non-server environments I recommend a "private static final" declaration.

Generally you have less pain without "static" but you have more instances, which may become a problem.

Regards
Boris



More information about the slf4j-user mailing list