Looks like a good contender for a wiki article... Cheers, Tim
Sent from my iPhone On 6 Oct 2009, at 01:12, Derek Chen-Becker <dchenbec...@gmail.com> wrote: > Changing the logging has to come at the very beginning of the boot > method. I'm using slf4j in a 1.0.2 project and it's working fine. > The very first line of my boot method is: > > LogBoot.loggerSetup = () => true > > which basically disables Lift setting up any logging (you'll have to > do your own configuration via xml or API). Try that and let me know > if you still have problems. > > Derek > > On Fri, Oct 2, 2009 at 3:02 PM, Christopher Mason > <cjma...@gmail.com> wrote: > > So, is this support only present post 1.0.2? Cause in 1.0.2 it seems > like log4j symbols are referenced before my Boot.boot() gets called > (see below). Also, what do you mean by "Configure slf4j to use > Slf4jLogBoot" (doc says "Note that slf4j back-end should be configured > previously to use Slf4jLogBoot." which also doesn't make sense to > me). Sorry I missed the Slf4jLogBoot class; I'm still learning how > to use Intellij to properly navigate scala code. > > Thanks! > > -c > > java.lang.NoClassDefFoundError: org/apache/log4j/LogManager > at net.liftweb.util.LogBoot$.log4jIsConfigured$1(Log.scala:114) > [massqc-1.3-foo-all.jar:na] > at net.liftweb.util.LogBoot$._log4JSetup(Log.scala:130) > [massqc-1.3- > foo-all.jar:na] > at net.liftweb.util.LogBoot$$anonfun$2.apply(Log.scala:96) > [massqc-1.3-foo-all.jar:na] > at net.liftweb.util.LogBoot$$anonfun$2.apply(Log.scala:96) > [massqc-1.3-foo-all.jar:na] > at net.liftweb.util.LogBoot$.checkConfig(Log.scala:94) > [massqc-1.3- > foo-all.jar:na] > at net.liftweb.util.LogBoot$.net$liftweb$util$LogBoot$$_logger > (Log.scala:140) [massqc-1.3-foo-all.jar:na] > at net.liftweb.util.LogBoot$$anonfun$3.apply(Log.scala:142) > [massqc-1.3-foo-all.jar:na] > at net.liftweb.util.LogBoot$$anonfun$3.apply(Log.scala:142) > [massqc-1.3-foo-all.jar:na] > at net.liftweb.http.LiftRules$.<init>(LiftRules.scala:559) > [massqc-1.3-foo-all.jar:na] > at net.liftweb.http.LiftRules$.<clinit>(LiftRules.scala) > [massqc-1.3- > foo-all.jar:na] > at net.liftweb.http.LiftFilter.init(LiftServlet.scala:554) > [massqc-1.3-foo-all.jar:na] > at org.eclipse.jetty.servlet.FilterHolder.doStart > (FilterHolder.java: > 74) [massqc-1.3-foo-all.jar:na] > > > Also > > On Oct 2, 3:58 am, Indrajit Raychaudhuri <indraj...@gmail.com> wrote: > > You can of course use slf4j instead of log4j in your application. > > > > Quick steps: > > > > 1. Exclude log4j from dependency tree by adding exclusion filter in > > lift-webkit dependency. POM should look something like this: > > > > <dependency> > > <groupId>net.liftweb</groupId> > > <artifactId>lift-webkit</artifactId> > > <version>1.1-SNAPSHOT</version> > > <exclusions> > > <exclusion> > > <groupId>log4j</groupId> > > <artifactId>log4j</artifactId> > > </exclusion> > > </exclusions> > > <dependency> > > > > 2. Add slf4j, logback dependencies in POM > > > > 3. Enable slf4j in Boot: > > > > Slf4jLogBoot.enable() > > > > 4. Configure slf4j to use Slf4jLogBoot > > > > Cheers, Indrajit > > > > NB: net.liftweb.util.Slf4jLogBoot has a nice scaladoc with the above > > steps. You might wish to go through that as well :-) > > > > On 02/10/09 1:50 PM, Christopher Mason wrote: > > > > > > > > > Is log4j a hard dependency to break? It seems like you're using > slf4j > > > most places, but then have some hard deps for configuration. I'm > > > using logback. How hard would it be for me to remove the log4j > dep > > > and replace with slf4j/logback. (I have logback already > configured in > > > my servlet container.) > > > > > Thanks! > > > > > -c > > > > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Lift" group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~----------~----~----~----~------~----~------~--~---