Printing the “source” class in a log statement with a log4j wrapper

后端 未结 3 1979
遇见更好的自我
遇见更好的自我 2021-01-02 19:02

My application has a homebrew logging class that I\'m migrating to using log4j under the covers. However, since I\'m using the homebrew class to pass the rest of the applica

3条回答
  •  轮回少年
    2021-01-02 19:59

    This should do it:

    class Logger2 {
    
      Logger _log4JLogger;
    
      public void log(Object msg) {
        _log4JLogger.log(Logger2.class.getName(), Priority.INFO, msg, null);
      }
    
    }
    

提交回复
热议问题