The best reference to better understand the correct iteraction with the most common used logging library is the google code wiki page.
The first problem I found is the answer to the question:" where the hell, I have to put my log4j.xml "
It seems no log4j.xml needed, but the configuration has to be somthing like that :
import org.apache.log4j.Level; import android.os.Environment; import de.mindpipe.android.logging.log4j.LogConfigurator; /** * Simply place a class like this in your Android applications classpath. */ public class ConfigureLog4J { static { final LogConfigurator logConfigurator = new LogConfigurator(); logConfigurator.setFileName(Environment.getExternalStorageDirectory() + "myapp.log"); logConfigurator.setRootLevel(Level.DEBUG); // Set log level of a specific logger logConfigurator.setLevel("org.apache", Level.ERROR); logConfigurator.configure(); } }

Nessun commento:
Posta un commento