Re: Q: running the tests / debugging / logging

From: Andrus (andru..bjectstyle.org)
Date: Tue Nov 19 2002 - 21:06:24 EST

  • Next message: Craig Miskell: "Insert order"

    At 11:24 PM 11/19/2002 +0000, Andrus Adamchik wrote:
    >>- how can I control log4j output when running the tests? Maybe I
    >>overlooked something but I couldn't find any way to specify this anywhere?
    >>Makes debugging really hard..
    >
    >Cayenne logging is awaiting its own chapter in the user guide :-). Here is
    >a pointer for now (it worked well with pre-ant unit tests, I don't know
    >how it works at all with JUnit Ant task though....). There is a special
    >file $HOME/.cayenne/cayenne-log.properties which is a regular log4j config
    >file that is loaded by Configuration class. When I get home, I will send a
    >sample that I have. Most Cayenne logging is done via
    >"accesss.QueryLogger", so this is an important class to control.

    As promised, here is my $HOME/.cayenne/cayenne-log.properties:

    ---------------------------------
    # General Log4J stuff
    log4j.rootLogger=WARN, A1
    log4j.appender.A1=org.apache.log4j.ConsoleAppender
    log4j.appender.A1.layout=org.apache.log4j.PatternLayout
    log4j.appender.A1.layout.ConversionPattern=cayenne %-5p [%t %d{MM-dd
    HH:mm:ss}] %c{1}: %m%n

    # indiv. packages configuration - turning on the packages that I care about
    #log4j.logger.org.objectstyle.cayenne = INFO
    #log4j.logger.org.objectstyle.cayenne.dba = WARN

    # This is the one that controls SQL output
    # Setting the level to INFO or DEBUG will turn the logs on

    log4j.logger.org.objectstyle.cayenne.access.QueryLogger = WARN

    ---------------------------------

    Andrus



    This archive was generated by hypermail 2.0.0 : Tue Nov 19 2002 - 21:05:46 EST