<div dir="ltr"><span style="font-family:arial,sans-serif;font-size:12.727272033691406px">Hey folks,</span><div style="font-family:arial,sans-serif;font-size:12.727272033691406px"><br></div><div style="font-family:arial,sans-serif;font-size:12.727272033691406px">
I am about 75% of the way there, but still scratching my head - can you please provide some guidance?</div><div style="font-family:arial,sans-serif;font-size:12.727272033691406px"><br></div><div style="font-family:arial,sans-serif;font-size:12.727272033691406px">
I have an Android project, and I would like our logging to appear:</div><div style="font-family:arial,sans-serif;font-size:12.727272033691406px"><br></div><div style="font-family:arial,sans-serif;font-size:12.727272033691406px">
1) In the Android LogCat tool (to keep our Android developers happy); and,</div><div style="font-family:arial,sans-serif;font-size:12.727272033691406px">2) A logfile on disk</div><div style="font-family:arial,sans-serif;font-size:12.727272033691406px">
<br></div><div style="font-family:arial,sans-serif;font-size:12.727272033691406px">I understand that slf4j is an abstraction layer, and one must include 'bindings' to hook up the slf4j API to one or more concrete logging components. Furthermore, I see there is an Android-specific adaptation of slf4j called slf4j-android-1.6.1. The benefit of the slf4j-android adaptation seems to be that it has a built-in binding to LogCat. </div>
<div style="font-family:arial,sans-serif;font-size:12.727272033691406px"><br></div><div style="font-family:arial,sans-serif;font-size:12.727272033691406px">So one ancillary question I have is why this is a repackaging of the slf4j code, when it seems like the preferred architecture would be simply to implement a slf4j-to-Android-logcat binding -- perhaps slf4j doesn't directly work on Android without some rejiggering. So I can accomplish 1) above by using slf4j-android.</div>
<div style="font-family:arial,sans-serif;font-size:12.727272033691406px"><br></div><div style="font-family:arial,sans-serif;font-size:12.727272033691406px">Then, to accomplish 2), I suppose I should use log4j to handle this because it's been around for a very long time and therefore it's likely to be very stable, which is important to us. But log4j doesn't work on Android off the shelf, due to its requirement of some java.beans.* classes that Android doesn't implement; so, there android-logging-log4j to the rescue! This basically provides an alternate means of configurating log4j without using the missing java.beans class(es). Works for me. So by adding log4j-1.2.17.jar and android-logging-log4j-1.0.3.jar, I get log4j support in my Android app.</div>
<div style="font-family:arial,sans-serif;font-size:12.727272033691406px"><br></div><div style="font-family:arial,sans-serif;font-size:12.727272033691406px">So here is where I'm not clear - how do I tie all of this together? It seems like I would need a slf4j-android to log4j-1.2 binding, and I'm not seeing this anywhere.</div>
<div style="font-family:arial,sans-serif;font-size:12.727272033691406px"><br></div><div style="font-family:arial,sans-serif;font-size:12.727272033691406px">Please clue me in. Thanks very much for your help!</div></div>