I have a Java Project with a lot of files, which is using LOG4J. Now I am trying to Port it to the Android platform. Is it possible to reuse the code as it is, with LOG4J function calls?
Current understanding:
- Property configuration won't work (beans dependency)
- I tried with LOG4J for Android and SL4J Lib. No success.
Working. But no use
org.apache.log4j.Logger root = org.apache.log4j.Logger.getRootLogger();
final SocketAppender appender = new SocketAppender("192.168.123.123", 3333);
root.addAppender(appender);
// SLF4J - Not working
org.slf4j.Logger logger;
logger = LoggerFactory.getLogger(MyClass.class);
// LOG4J for Android - Not working
ConfigureLog4J.configure();
logger = Logger.getLogger( MyClass.class );
Am I missing something? Pointer to any working examples?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…