tags:

views:

77

answers:

1

I am using java.util.logging.Logger

But with storing messages in a log file, it also writes messages to the standard output (console).

How can I disable the logger to display messages on standard output?

+1  A: 

If you're new to logging you should read Java Logging Overview. You should also post your configuration

This snippet shows how to write log messages into a file:

public static void main(String[] args){
    Handler fh = new FileHandler("%t/wombat.log");
    Logger.getLogger("").addHandler(fh);
    Logger.getLogger("com.wombat").setLevel("com.wombat",Level.FINEST);
    ...
}
stacker