Each logger can have access to several handler.
The handler receives the log message from the logger and exports it to a certain target
A handler can be turn off with setLevel(Level.OFF) and turned on with setLevel(...)
You have several standard handler, e.g.
Log Levels INFO and higher will be automatically written to the console.
See log formatter.
The handler receives the log message from the logger and exports it to a certain target
A handler can be turn off with setLevel(Level.OFF) and turned on with setLevel(...)
You have several standard handler, e.g.
- ConsoleHandler: Write the log message to console
- FileHandler: Writes the log message to file
Handler[] handlers = Logger.getLogger( "" ).getHandlers();
//Now you can set individual handler level like this:
handlers[index].setLevel( Level.FINE );
See log formatter.
No comments:
Post a Comment