com.aoindustries.website
Class LogFactory

java.lang.Object
  extended by com.aoindustries.website.LogFactory

public class LogFactory
extends java.lang.Object

Provides static access to the logging facilities. The logs are written into the AOServ ticket system under the type "logs".

Author:
AO Industries, Inc.

Field Summary
static java.lang.String ATTRIBUTE_NAME
           
 
Method Summary
static java.util.logging.Logger getLogger(javax.servlet.ServletContext servletContext, java.lang.Class clazz)
          Gets the logger for the provided ServletContext and class.
static java.util.logging.Logger getLogger(javax.servlet.ServletContext servletContext, java.lang.String name)
           Gets the logger for the provided ServletContext and name.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ATTRIBUTE_NAME

public static final java.lang.String ATTRIBUTE_NAME
Method Detail

getLogger

public static java.util.logging.Logger getLogger(javax.servlet.ServletContext servletContext,
                                                 java.lang.Class clazz)
Gets the logger for the provided ServletContext and class.


getLogger

public static java.util.logging.Logger getLogger(javax.servlet.ServletContext servletContext,
                                                 java.lang.String name)

Gets the logger for the provided ServletContext and name. The logger is stored as a context attribute under the name (ATTRIBUTE_NAME+'.'+name). Subsequent calls to this method will return the previously created logger. If an error occurs while creating the logger it will return the default logger. In this case, it will not add the logger to the servletContext, which will cause it to try again until a fully functional logger is available.

Callers of this class should reqest a logger each time they need one and not cache/reuse the logger provided by this method. This allows for the automatic retry on logger creation.