Class Log4J

java.lang.Object
marauroa.common.Log4J

public class Log4J extends Object
This is a convenience class for initializing log4j Please when using Log4j follow the next rules:
  • debug just debug info that may be need to find a bug.
  • info is just important information that we should be aware to spot behaviors on application.
  • warn is a problem that application will handle itself
  • error is a big problem on the application that it can't handle.
  • fatal is such a problem that the application will stop.
Author:
Matthias Totz
  • Constructor Details

    • Log4J

      public Log4J()
  • Method Details

    • init

      public static void init()
      initializes log4j with the log4j.properties file.
    • init

      public static void init(String filename)
      initializes log4j with a custom properties file.
      Parameters:
      filename - log4j.properties
    • getLogger

      public static Logger getLogger(Class<?> clazz)
      returns a logger for the given class. Use this function instead of Logger.getLogger(clazz);. If the logging mechanism changes it will be done here and not in every class using a logger.
      Parameters:
      clazz - the Class requesting a logger
      Returns:
      the logger instance