title: slf4j add custom method
body: <p>I have to add custom method method to my logging system. Let's say I have in several places line of code like: 
  <code>private static Logger LOGGER = LoggerFactory.getLogger(MyJavaClass.class);</code></p>
  
  <p>Logging is handling by slf4j. How can I extend my logger with adding new(!) method like <code>public void error(SomeTypeObject obj) { /implementation/ }</code>  </p>
  
  <p>The goal is to not change existing code. How can I force LoggerFactory to return my own Logger implementation extended with mentioned method?</p>
  
  <p>I followed answers for this queston: stackoverflow.com/questions/2653855/implement-custom-logger-with-slf4j</p>
  
  <p>So, I've made my LoggerFactory, StaticLoggerBinder and MyLoggerAdapter.</p>
  
  <p><strong>StaticLoggerBinder</strong>  </p>
  
  <pre><code>public class StaticLoggerBinder implements LoggerFactoryBinder {
  
      private static final StaticLoggerBinder SINGLETON = new StaticLoggerBinder();
  
      public static final StaticLoggerBinder getSingleton() {
          return SINGLETON;
      }
  
      public static String REQUESTED_API_VERSION = "1.6.99";
  
      private static final String loggerFactoryClassStr = MyLoggerFactory.class.getName();
  
      private final ILoggerFactory loggerFactory;
  
      private StaticLoggerBinder() {
          loggerFactory = new MyLoggerFactory();
      }
  
      public ILoggerFactory getLoggerFactory() {
          return loggerFactory;
      }
  
      public String getLoggerFactoryClassStr() {
          return loggerFactoryClassStr;
      }
  }
  </code></pre>
  
  <p><strong>Logger Factory</strong>  </p>
  
  <pre><code>public class MyLoggerFactory implements ILoggerFactory {
  
      ConcurrentMap&lt;String, Logger&gt; loggerMap;
  
      public MyLoggerFactory() {
          loggerMap = new ConcurrentHashMap&lt;String, Logger&gt;();
      }
  
      public Logger getLogger(String name) {
          Logger simpleLogger = loggerMap.get(name);
          if (simpleLogger != null) {
              return simpleLogger;
          } else {
              Logger newInstance = new MyLoggerAdapter(name);
              Logger oldInstance = loggerMap.putIfAbsent(name, newInstance);
              return oldInstance == null ? newInstance : oldInstance;
          }
      }
  
      void reset() {
          loggerMap.clear();
      }
  }
  </code></pre>
  
  <p><strong>MyLogger</strong>  </p>
  
  <pre><code>public class MyLoggerAdapter implements Logger {
  //methods from Logger interface
  //and my additional method
  
      public void error(Exception ex) {
          //do smthng;
      }
  }
  </code></pre>
  
  <p>Now, in MyJavaClass i have a field
  <code>private static Logger LOGGER = LoggerFactory.getLogger(MyJavaClass.class);</code></p>
  
  <p>The problem is, when i try to <code>LOGGER.error(myExceptionObject)</code> the method is not visible. I am missing something. I would be very grateful for help.</p>