org.glassfish.grizzly.utils
Class LoggingFormatter
java.lang.Object
java.util.logging.Formatter
org.glassfish.grizzly.utils.LoggingFormatter
public class LoggingFormatter
- extends Formatter
Format the record to include the Thread that logged the record.
To change the default configuration for java.util.logging you will need to
add this in the command line parameters : -Djava.util.logging.config.file=myfile
Here a sample of what you need to include in myfile
#the default logger is this add you can replace it with LoggingFormatter
#java.util.logging.ConsoleHandler.formatter = java.util.logging.SimpleFormatter
java.util.logging.ConsoleHandler.formatter = com.glassfish.grizzly.utils.LoggingFormatter
refer to : https://grizzly.dev.java.net/issues/show_bug.cgi?id=291
- Author:
- Sebastien Dionne
Method Summary |
String |
format(LogRecord record)
Format the record to include the Thread that logged this record. |
static void |
main(String[] args)
Example to test the com.glassfish.grizzly.utils.LoggingFormatter
You need to include this parameter in the command line
-Djava.util.logging.config.file=myfile |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
LoggingFormatter
public LoggingFormatter()
format
public String format(LogRecord record)
- Format the record to include the Thread that logged this record.
the format should be
[WorkerThreadImpl-1, Grizzly] 2008-10-08 18:49:59 [INFO] com.glassfish.grizzly.Controller:doSelect message
- Specified by:
format
in class Formatter
- Parameters:
record
- The record to be logged into the logger.
- Returns:
- the record formated to be more human readable
main
public static void main(String[] args)
- Example to test the com.glassfish.grizzly.utils.LoggingFormatter
You need to include this parameter in the command line
-Djava.util.logging.config.file=myfile
- Parameters:
args
- main parameters
Copyright © 2012 Oracle Corporation. All Rights Reserved.