Hi Malcolm and Joe,

I have to echo Joe's comments: Velocity's behaviour with log4j and Commons 
Logging is one of the things I find I find most irritating in general 
development terms (as everything else is so nice and simple and works fine on 
the whole).

I have _never_ been able to get logging to work satisfactorily (admittedly, I 
gave up a while back and haven't tried again).

Why a log4j.xml rather than properties?

I always have log4j.properties at the root of the classpath: this gets 
routinely ignored by Velocity, I'm sorry to say.

It's not too big a deal to me and can accept a separate log file, but it would 
be good if (like many other apps/frameworks; e.g. Spring) Velocity just 
transparently picked-up my log4j config and output to the same file as 
everything else.

Chris

> -----Original Message-----
> From: Malcolm Edgar [mailto:[EMAIL PROTECTED] 
> Sent: 17 July 2007 14:13
> To: Velocity Users List
> Subject: Re: Can't make it log with log4j
> 
> I would recommend using the log4j.xml configuration file, and put it
> somewhere up high in your class path.
> 
> regards Malcolm Edgar
> 
> On 7/17/07, Joe Kramer <[EMAIL PROTECTED]> wrote:
> >
> > Hello,
> >
> > I have hard time taming velocity log output.
> > My webapp uses log4j globally.
> > velocity.properties has the following:
> >   runtime.log.logsystem.class =
> > org.apache.velocity.runtime.log.Log4JLogChute
> >   runtime.log.logsystem.log4j.category=velocity
> >
> > log4j.properties:
> >   log4j.rootCategory=INFO, LOGFILE
> >   log4j.appender.LOGFILE=org.apache.log4j.FileAppender
> >   ...
> >   log4j.velocity=WARN
> >   log4j.org.apache.velocity=WARN
> >
> > Regardless of above configuration, velocity creates it's own
> > velocity.log and logs with some default settings.
> > What is more strange, every message is velocity.log is 
> repeated 5 to 6
> > times!
> >
> > Can anyone point me the best practice to configure velocity 
> with log4j ?
> >
> > Thanks.
> >
> > 
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
> 

********************************************************************************
   
DISCLAIMER: This e-mail is confidential and should not be used by anyone who is
not the original intended recipient. If you have received this e-mail in error
please inform the sender and delete it from your mailbox or any other storage
mechanism. Neither Macmillan Publishers Limited nor any of its agents accept
liability for any statements made which are clearly the sender's own and not
expressly made on behalf of Macmillan Publishers Limited or one of its agents.
Please note that neither Macmillan Publishers Limited nor any of its agents
accept any responsibility for viruses that may be contained in this e-mail or
its attachments and it is your responsibility to scan the e-mail and 
attachments (if any). No contracts may be concluded on behalf of Macmillan 
Publishers Limited or its agents by means of e-mail communication. Macmillan 
Publishers Limited Registered in England and Wales with registered number 
785998 
Registered Office Brunel Road, Houndmills, Basingstoke RG21 6XS   
********************************************************************************

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to