Top Description Fields Constructors Methods
org.glassfish.grizzly.utils

public Class LoggingFormatter

extends Formatter
Class Inheritance
Imports
java.io.PrintWriter, .StringWriter, java.util.Date, java.util.logging.Formatter, .Level, .LogRecord, .Logger

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

Field Summary

Modifier and TypeField and Description
private static String
private static final Logger

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public String

Returns:

the record formated to be more human readable
format
(LogRecord
The record to be logged into the logger.
record
)

Implements abstract java.util.logging.Formatter.format.

Format the record to include the Thread that logged this record.

public static void
main(String[]
main parameters
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

Inherited from java.util.logging.Formatter:
formatMessagegetHeadgetTail

Field Detail

lineSeparatorback to summary
private static String lineSeparator
logback to summary
private static final Logger log

Constructor Detail

LoggingFormatterback to summary
public LoggingFormatter()

Method Detail

formatback to summary
public String format(LogRecord record)

Implements abstract java.util.logging.Formatter.format.

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

Parameters
record:LogRecord

The record to be logged into the logger.

Returns:String

the record formated to be more human readable

Annotations
@Override
mainback to summary
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:String[]

main parameters