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

hmm.  this second property should be :

runtime.log.logsystem.log4j.logger = velocity

and then you can also directly control the level by setting:

runtime.log.logsystem.log4j.logger.level = WARN

(though note that WARN is the default)

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.

it does that when you don't specify a
runtime.log.logsystem.log4j.logger property.  it assumes in the
absence of a specified logger, that it should use it's defaults (which
include creating a rolling file appender).

What is more strange, every message is velocity.log is repeated 5 to 6 times!

that is very peculiar.  can i see one of those logs? i'm not sure how
that could happen.


Can anyone point me the best practice to configure velocity with log4j ?

http://velocity.apache.org/engine/devel/developer-guide.html#configuring_logging

Unfortunately, i just looked at that and it incorrectly says that the
"category" option is still supported. :(  This probably explains why
you were using that suffix instead of "logger".  Argh.  I'll see about
getting the documentation fixed.  Sorry for the confusion.

Thanks.

---------------------------------------------------------------------
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]

Reply via email to