Skip to content
Advertisement

LOG4J in Android

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:

  1. Property configuration won’t work (beans dependency)
  2. I tried with LOG4J for Android and SL4J Lib. No success.

Working. But no use

JavaScript

Am I missing something? Pointer to any working examples?

Advertisement

Answer

Solved by using the android-logging-log4j.jar.

Here is sample code:

JavaScript

In your code, replace the below lines:

JavaScript

With:

JavaScript
User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement