com.ontimize.util.gis.server.logger
Class GisLogger

java.lang.Object
  extended by com.ontimize.util.gis.server.logger.GisLogger
All Implemented Interfaces:
IGisLogger

public class GisLogger
extends java.lang.Object
implements IGisLogger


Field Summary
static boolean GIS_LOGGER_ACTIVE
           
protected static org.apache.log4j.Logger logger
           
protected static IGisLogger loggerInstance
           
static boolean logLibraryFails
           
 
Fields inherited from interface com.ontimize.util.gis.server.interfaces.IGisLogger
LOG_DEBUG, LOG_ERROR, LOG_FATAL, LOG_INFO, LOG_TRACE, LOG_WARN
 
Constructor Summary
GisLogger()
           
 
Method Summary
 void addLog(java.lang.Object o, int level)
          Level values are in this class as static values:
LOG_TRACE, LOG_INFO, LOG_WARN, LOG_ERROR, LOG_FATAL
 void addRemoteAppender(java.lang.String host, int port)
          Add a remote appender to the log4j
 org.apache.log4j.Logger getLogger()
           
static IGisLogger getLoggerInstance()
          Get the IGisLogger instance reference.
 void initLog(java.lang.Class parentClass, java.lang.Object propertiesNode)
          Initialize the logger with specified properties file xml node
 void initLog(java.lang.Class parentClass, java.lang.String propertiesPath)
          Initialize the logger with specified properties file
 void removeRemoteAppender(java.lang.String host, int port)
          Remove a remote appender for log4j
static void setLoggerInstance(IGisLogger logger)
          Set the logger class only if loggerInstance is null
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logLibraryFails

public static boolean logLibraryFails

GIS_LOGGER_ACTIVE

public static boolean GIS_LOGGER_ACTIVE

logger

protected static org.apache.log4j.Logger logger

loggerInstance

protected static IGisLogger loggerInstance
Constructor Detail

GisLogger

public GisLogger()
Method Detail

getLoggerInstance

public static IGisLogger getLoggerInstance()
Get the IGisLogger instance reference. Create a GisLogger instance of not exists.

Returns:
Logger instance

setLoggerInstance

public static void setLoggerInstance(IGisLogger logger)
                              throws java.lang.Exception
Set the logger class only if loggerInstance is null

Parameters:
logger -
Throws:
java.lang.Exception

addRemoteAppender

public void addRemoteAppender(java.lang.String host,
                              int port)
Add a remote appender to the log4j

Parameters:
host - Remote host
port - Port

removeRemoteAppender

public void removeRemoteAppender(java.lang.String host,
                                 int port)
Remove a remote appender for log4j

Parameters:
host - Remote host
port - Port

initLog

public void initLog(java.lang.Class parentClass,
                    java.lang.String propertiesPath)
Description copied from interface: IGisLogger
Initialize the logger with specified properties file

Specified by:
initLog in interface IGisLogger
propertiesPath - Properties file path

addLog

public void addLog(java.lang.Object o,
                   int level)
Level values are in this class as static values:
LOG_TRACE, LOG_INFO, LOG_WARN, LOG_ERROR, LOG_FATAL

Specified by:
addLog in interface IGisLogger
Parameters:
o - Message
level - Log level (ERROR, WARNING...)

initLog

public void initLog(java.lang.Class parentClass,
                    java.lang.Object propertiesNode)
Description copied from interface: IGisLogger
Initialize the logger with specified properties file xml node

Specified by:
initLog in interface IGisLogger
propertiesNode - Properties xml node

getLogger

public org.apache.log4j.Logger getLogger()