Re: Configuring logging

From: Andrus Adamchik (andru..bjectstyle.org)
Date: Thu Feb 16 2006 - 17:29:55 EST

  • Next message: chad smith: "Q: re: SQLTemplate"

    ".cayenne" location is actually ok. But the problem here is
    undeterministic behavior of the ClassLoader - if it finds a default
    ".cayenne/cayenne-log.properties" inside cayenne.jar, it won't look
    any further.

    The .cayenne location is more appropriate for desktop apps than the
    web apps anyways. My suggestion to Dov would be to put a custom Log
    properties file somewhere in a known location (such as WEB-INF/), and
    then load it explicitly via Log4J PropertyConfigurator, using a
    preferred web application bootstrapping mechanism.

    I usually extend one of Cayenne filters or listeners to do that. This
    ensures that custom logging configuration is loaded before Cayenne
    starts.

    Andrus

    On Feb 16, 2006, at 5:15 PM, Steve Wells wrote:

    >
    > Have you tryed moving it up a level to the classes folder? I don't
    > think Cayenne searches in a .cayenne folder for this.
    >
    >
    > --
    > http://www.fastmail.fm - Email service worth paying for. Try it for
    > free
    >
    > ----- Original message -----
    > From: "Dov Rosenberg" <dov.rosenber..onviveon.com>
    > To: "cayenne-use..bjectstyle.org" <cayenne-user@objectstyle.org>
    > Date: Thu, 16 Feb 2006 13:57:45 -0500
    > Subject: Configuring logging
    >
    > I have created a servlet that gets loaded using Tomcat 5.0.28 that
    > uses
    > Cayenne. I am trying to change the default logging behavior to stop
    > dumping
    > the SQL statements so I can properly deploy the application. I have
    > created
    > a cayenne-log.properties file and stored it in the
    > /WEB-INF/classes/.cayenne
    > folder to no avail. Can someone help me figure out what is going
    > wrong?
    >
    > Here is the contents of my
    > /WEB-INF/classes/.cayenne/cayenne-log.properties
    > file it doesnąt seemd to be getting read during startup.
    >
    > ***************
    >
    >
    > log4j.rootLogger=WARN, A1
    > log4j.appender.A1=org.apache.log4j.ConsoleAppender
    > log4j.appender.A1.layout=org.apache.log4j.PatternLayout
    > log4j.appender.A1.layout.ConversionPattern=%-5p %c{1}: %m%n
    >
    > # General Cayenne logging
    > log4j.logger.org.objectstyle.cayenne = WARN
    > log4j.logger.org.objectstyle.cayenne.access.QueryLogger = INFO
    >
    > # GUI-related logging
    >
    > # reduce Scope logging
    > log4j.logger.org.scopemvc = INFO
    >
    > # set modeler to INFO
    > log4j.logger.org.objectstyle.cayenne.modeler = INFO
    >
    >
    >



    This archive was generated by hypermail 2.0.0 : Thu Feb 16 2006 - 17:29:58 EST