title: Java custom logger: logging standards or/and best practices
body: <p>I am developing a framework and I want the jar to be light weight and independent as much as it can be.</p>
  
  <p>So I wrote a logging class:</p>
  
  <pre class="lang-java prettyprint-override"><code>import java.util.Date;
  import java.util.Properties;
  
  public class Logger {
  
      private static final Logger me = new Logger();
      private static boolean info = false;
      private static boolean debug = false;
      private static boolean error = false;
      private static String className = null;
  
      public static Logger getInstance(Class&lt;?&gt; clazz) {  
          className = clazz.getCanonicalName();
          try {
              Properties props = new CustProps().load(clazz);
              if(props.get(CustProps.NAME_LOG_MODE) != null) {
                  String devMode = props.getProperty(CustProps.NAME_LOG_MODE)
                                     .toLowerCase();
                  if("info".equals(devMode)) {
                      info = true;
                      debug = true;
                  } else if("debug".equals(devMode)) {
                      debug = true;
                  } 
              }
          } catch (Exception e) {
              // debug is error by default
          }
  
          error = true;
          return me;
      }
  
      public void logError(Object msg) {
          if(isError()) {
              System.out.println(new Date().toString()
                + " ERROR ["+Logger.className+"] - " + msg);
          }
      }
  
      public void logDebug(Object msg) {
          if(isDebug()) {
              System.out.println(new Date().toString()
                + " DEBUG ["+Logger.className+"] - " + msg);
          }
      }
  
      public void logInfo(Object msg) {
          if(isInfo()) {
              System.out.println(new Date().toString()
                + " INFO ["+Logger.className+"] - " + msg);
          }
      }
  
      public boolean isInfo() { return Logger.info; }
  
      public boolean isDebug() { return Logger.debug; }
  
      public boolean isError() { return Logger.error; }
  
  }
  </code></pre>
  
  <ul>
  <li>What are the best practices to make this logging better? </li>
  <li>Is making your own logger even worth it?</li>
  <li>Will the use of this logger make my framework worse than choosing something existing (like <code>log4j</code>)?</li>
  </ul>