Class JavaLogFactory

  • All Implemented Interfaces:
    LogFactory

    public class JavaLogFactory
    extends java.lang.Object
    implements LogFactory
    Reference implementation of the LogFactory and Logger interfaces. This implementation uses the Java logging package, and marks each log message with the currently logged in user and the word "SECURITY" for security related events. See the JavaLogFactory.JavaLogger Javadocs for the details on the JavaLogger reference implementation.
    Since:
    June 1, 2007
    Author:
    Mike Fauzy (mike.fauzy@aspectsecurity.com) Aspect Security, Jeff Williams (jeff.williams .at. aspectsecurity.com) Aspect Security
    See Also:
    LogFactory, JavaLogFactory.JavaLogger
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  JavaLogFactory.JavaLoggerLevel
      A custom logging level defined between Level.SEVERE and Level.WARNING in logger.
    • Constructor Summary

      Constructors 
      Constructor Description
      JavaLogFactory()
      Null argument constructor for this implementation of the LogFactory interface needed for dynamic configuration.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static LogFactory getInstance()  
      Logger getLogger​(java.lang.Class clazz)
      Gets the logger associated with the specified class.
      Logger getLogger​(java.lang.String moduleName)
      Gets the logger associated with the specified module name.
      • Methods inherited from class java.lang.Object

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

      • JavaLogFactory

        public JavaLogFactory()
        Null argument constructor for this implementation of the LogFactory interface needed for dynamic configuration.
    • Method Detail

      • getInstance

        public static LogFactory getInstance()
      • getLogger

        public Logger getLogger​(java.lang.Class clazz)
        Gets the logger associated with the specified class. The class is used by the logger to log which class is generating the log events. The implementation of this method should return any preexisting Logger associated with this class name, rather than creating a new Logger.

        The JavaLogFactory reference implementation meets these requirements.
        Specified by:
        getLogger in interface LogFactory
        Parameters:
        clazz - The name of the class requesting the logger.
        Returns:
        The Logger associated with this class.
      • getLogger

        public Logger getLogger​(java.lang.String moduleName)
        Gets the logger associated with the specified module name. The module name is used by the logger to log which module is generating the log events. The implementation of this method should return any preexisting Logger associated with this module name, rather than creating a new Logger.

        The JavaLogFactory reference implementation meets these requirements.
        Specified by:
        getLogger in interface LogFactory
        Parameters:
        moduleName - The name of the module requesting the logger.
        Returns:
        The Logger associated with this module.