logger configuration

531 views
Skip to first unread message

sledorze

unread,
Feb 17, 2011, 10:44:03 AM2/17/11
to Lift
Hi!

I'm trying to configure properly my logger (the test is to change
SquerylRecord logging level to INFO),

I've followed the wiki instructions without any success:
http://www.assembla.com/wiki/show/liftweb/Logging

(
I've opted for the log4j.xml file under resources/props/

and make sure to call..
LiftRules.configureLogging = LoggingAutoConfigurer()
.. before any logger instanciation
)

What am I missing here? (the xml is set below)
Any help welcomed..

Stephane.



<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">

<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">
<appender name="console" class="org.apache.log4j.ConsoleAppender">
<param name="Target" value="System.out"/>
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern" value="%-5p %c{1} - %m%n"/>
</layout>
</appender>

<root>
<priority value ="info" />
<appender-ref ref="console" />
</root>

<logger name="n.l.squerylrecord.SquerylRecord">
<level value="INFO"/>
<appender-ref ref="console" />
</logger>

</log4j:configuration>

Jeppe Nejsum Madsen

unread,
Feb 17, 2011, 10:55:38 AM2/17/11
to lif...@googlegroups.com
Hi,

What is the name of your log4j.xml? It should be default.log4j.xml (if you're running in dev mode)

You shouldn't need to mess with LiftRules, as the AutoConfigurer is the default.

Are you sure you're using log4j? I think the default archetypes are now using Logback, check your dependencies

Also the logger name for SquerylRecord is not correct, I think you're using the abbrevated names shown by Logback....A guess is that it should be net.liftweb.squerylrecord.SquerylRecord

 
/Jeppe


--
You received this message because you are subscribed to the Google Groups "Lift" group.
To post to this group, send email to lif...@googlegroups.com.
To unsubscribe from this group, send email to liftweb+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/liftweb?hl=en.


sledorze

unread,
Feb 17, 2011, 11:46:16 AM2/17/11
to Lift
Thanks,
Indeed, all your presumptions were true.
I'll configure logback then.. :)

Stephane

On 17 fév, 16:55, Jeppe Nejsum Madsen <je...@ingolfs.dk> wrote:
> Hi,
>
> What is the name of your log4j.xml? It should be default.log4j.xml (if
> you're running in dev mode)
>
> You shouldn't need to mess with LiftRules, as the AutoConfigurer is the
> default.
>
> Are you sure you're using log4j? I think the default archetypes are now
> using Logback, check your dependencies
>
> Also the logger name for SquerylRecord is not correct, I think you're using
> the abbrevated names shown by Logback....A guess is that it should be
> net.liftweb.squerylrecord.SquerylRecord
>
>
>
> /Jeppe
>
> > "Lift" group.> To post to this group, send email toli...@googlegroups.com.

sledorze

unread,
Feb 17, 2011, 11:51:11 AM2/17/11
to Lift
Everything's fine by soon, thanks!
> > > You received this message because you are subscribed to the Google Groups> > "Lift" group.> To post to this group, send emailto...@googlegroups.com.> > To unsubscribe from this group, send email to>liftweb+u...@googlegroups.com.

Joa Ebert

unread,
Feb 17, 2011, 12:38:07 PM2/17/11
to lif...@googlegroups.com
I have a similar issue and any help would be greatly appreciated. 

Indrajit Raychaudhuri

unread,
Feb 17, 2011, 1:52:20 PM2/17/11
to lif...@googlegroups.com
Joa,

Like Jeppe said, you do *not* need to do anything with Logger.setup or
LiftRules.configureLogging.

All you should do is:
1. have the xml in the right place with the right name (dev mode is
default - so your file should be default.log4j.xml).
2. Add *both* log4j and slf4j-log4j12 as dependency in you Maven or SBT
config

- Indrajit

> --
> You received this message because you are subscribed to the Google
> Groups "Lift" group.

> To post to this group, send email to lif...@googlegroups.com.

Joa Ebert

unread,
Feb 17, 2011, 2:20:12 PM2/17/11
to lif...@googlegroups.com
Thank you Indrajit, in fact the issue was that logback was still included in the classpath and there were two slf4j bindings. It works now like a charm!
Reply all
Reply to author
Forward
0 new messages