Class LoggingFormatter


  • public class LoggingFormatter
    extends java.util.logging.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

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String format​(java.util.logging.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
      static void main​(java.lang.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.util.logging.Formatter

        formatMessage, getHead, getTail
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • LoggingFormatter

        public LoggingFormatter()
    • Method Detail

      • format

        public java.lang.String format​(java.util.logging.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 java.util.logging.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​(java.lang.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