I have been integrating logger facility using slf4j in android.I can able to write log successfully by using following methods
private static final Logger logger = LoggerFactory.getLogger(MyClass.class);
lo开发者_运维百科gger.debug("Some log message. Details: {}", someObject.toString());
,how ever i need to get the log file in order to send it to the server.
can anybody help me?
You may be interested in the following implementations of SLF4J:
- Android Logger is the lightweight but easy-to-configure SLF4J implementation (< 50 Kb).
- LOGBack is the most powerful and optimized implementation but its size is about 1 Mb.
- slf4j-android, slf4android (on github.com).
As far as the slf4j documentation for android says it is just a fascade that uses the native android logger to see the log info in DDMS.
if you want to upload logs you need to save them to a file or something like that. and then upload. See the java File writer methods and search also for ways to upload files in java,
if you want logging support that will handle sending error reports to a server there is a really nice library for android called ACRA. its excelent. you can post to google forms or post to your own server among some other really neat features.
ACRA
精彩评论