Oh, no worries. I wasn't irritated. Puzzled by Joe's second to last email, but that's it. I'm also glad this brought to light the documentation problems. Docs are unfortunately often the last thing to get proper attention, though they're the first thing most users encounter. Any help there is always very appreciated!!!
On 7/18/07, Townson, Chris <[EMAIL PROTECTED]> wrote:
Hi Nathan, I'm sorry if what I said about logging has caused you irritation in any way. I appreciate that you have done a lot of work on the logging side of things for the latest Velocity release. Implicit in my "I cannot get this to work either" statement was an acceptance that this was to do with my own mis-configuration ... but what I wanted to point out (in support of Joe) was that I certainly do not think that I am alone in that. I think this thread has been very useful because it has clarified this issue (certainly for me, at least) and brought to light the fact that some of the documentation may have been a little misleading/out of date (which happens). All the best, Chris > -----Original Message----- > From: Nathan Bubna [mailto:[EMAIL PROTECTED] > Sent: 17 July 2007 18:46 > To: Velocity Users List > Subject: Re: Can't make it log with log4j > > On 7/17/07, Joe Kramer <[EMAIL PROTECTED]> wrote: > > > > > > i'm not sure what you mean by "used by" here. Velocity > shunts all log > > > messages through the LogChute of choice. if you tell it > to use the > > > Log4jLogChute, it will either use a specific logger that > you tell it > > > to use, or else it will create a default one. where in > this should we > > > be looking at a log4j.properties file? and to what end? > > > > How can I make velocity work with log4j configured with other stuff? > > again, you just point the Velocity at the already created > logger using the > > runtime.log.logsystem.log4j.logger = <enter name of your already > configured and created logger here> > > > After reading this discussion I am in doubt that its > possible at all. > > why? everyone (except Chris) have been essentially saying "it works, > here's how". why doubt those of us for whom it works just because you > and one other person have had a hard time getting it working? > > > Configured everything as it's supposed to be from what I found in > > documentation on website. > > the documentation contains old stuff (i.e. anything about "category" > instead of "logger"). i explained this and am in the process of > filing a bug report to remind myself to fix it. > > > Log4j is initialized in my webapp before anything else. > > shouldn't be a problem. > > > Velocity still creates own velocity.log and logs in its own > pattern and level. > > this is probably because it doesn't know which logger you want it to > use. see above. > > > > > > > > > > > > In fact, velocity is the only library I work with > regularly for which this setup does not work > > > > ... which has always struck me as curious - but not > curious enough that I have felt the > > > > need to investigate and fix :D > > > > > > > > C > > > > > > > > > -----Original Message----- > > > > > From: Will Glass-Husain [mailto:[EMAIL PROTECTED] > > > > > Sent: 17 July 2007 14:56 > > > > > To: Velocity Users List > > > > > Subject: Re: Can't make it log with log4j > > > > > > > > > > Joe/Chris-- > > > > > > > > > > I use log4j in some of my apps, haven't had much trouble. > > > > > > > > > > Are you using Velocity 1.5? Velocity's logging behavior was > > > > > cleaned up > > > > > substantially in the last release. The > > > > > "velocity.log" file is generated by the Avalon logkit, it > > > > > shouldn't appear > > > > > if you use Log4J. Try removing "logkit.jar" from > your classpath. > > > > > > > > > > One thing that causes problems is when random third-party > > > > > libraries (cough - > > > > > Axis2!) include a log4j.properties in their jar file. Since > > > > > log4j looks for > > > > > the first log4j.properties it can find, if it hits some other > > > > > library's file > > > > > first it will ignore the log4j for your main app. > > > > > > > > > > I solve this by either (A) manually initializing log4j in my > > > > > app startup > > > > > with the correct properties file or (B) just being careful > > > > > that there's only > > > > > one log4j.properties in my classpath. > > > > > > > > > > WILL > > > > > > > > > > On 7/17/07, Townson, Chris <[EMAIL PROTECTED]> wrote: > > > > > > > > > > > > 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. > > > > > > > > > > > > ******************************************************************************** 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]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
