Skip to content

Instantly share code, notes, and snippets.

@olim7t
Created September 16, 2010 11:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save olim7t/582286 to your computer and use it in GitHub Desktop.
Save olim7t/582286 to your computer and use it in GitHub Desktop.
/* Basic j.u.l config for simple projects */
import java.util.logging.Level;
import java.util.logging.Logger;
public class Jul{
static {
Logger.getLogger("").setLevel(Level.SEVERE);
final Logger myLogger = Logger.getLogger("com.mycompany");
myLogger.setLevel(Level.FINEST);
}
public static void main(final String[] args) {
Logger.getLogger("com.mycompany").info("Should log");
Logger.getLogger("com.mycompany.Test").info("Should log");
Logger.getLogger("com.othercompany.Test").info("Should not log");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment