Re: Cayenne logging

From: Andrus Adamchik (andru..bjectstyle.org)
Date: Thu Jun 11 2009 - 11:40:08 EDT

  • Next message: Joe Baldwin: "Re: Cayenne logging"

    I see, sorry for the confusion.

    As an aside Log4J *project* seems to be either dead or on life
    support, abandoned by its authors, who moved to write the new logging
    frameworks, which may or may not work with commons-logging. Still the
    latest stable version of Log4J works great. Just figured I'd mention..

    This Log4J doc may get you started:

    http://logging.apache.org/log4j/1.2/manual.html

    In short, when your application starts, and before Cayenne is loaded,
    you have to manually bootstrap log4j using PropertyConfigurator class,
    specifying the config file:

       PropertyConfigurator.configure(myFile);

    This way you can't possibly misplace the config file (you'll get an
    exception), and all your logging configuration will be accounted for.

    Andrus

    On Jun 11, 2009, at 5:59 PM, Joe Baldwin wrote:
    > Andrus,
    >
    > I have not used log4j very much and definitely am not an expert at
    > configuring it. I have not been able to implement the instructions
    > found at
    > http://cayenne.apache.org/doc/configuring-logging.html
    > so that I can control logging.
    >
    > Quoting from 3.0M6 docs on your website:
    > "Commons-logging allows users to choose their own logging provider,
    > such as Log4J or java.util.logging."
    > This is what I was attempting to convey in my last message (sorry, I
    > was not trying to comment on 2.0 configuration)
    >
    > Furthermore, when I attempted to implement the example to turn SQL
    > tracing off:
    > log4j.logger.org.apache.cayenne.access.QueryLogger = WARN
    > I found that there was no change in the output.
    >
    > So I can only assume that I am missing some fundamental part of the
    > primer. My last theory is that I have either placed my cayenne-
    > log.properties file in the wrong location, or I my configuration
    > parameters are incomplete.
    >
    > Do you have any suggestions.
    >
    > Joe
    >
    >
    >
    >
    > On Jun 11, 2009, at 10:37 AM, Andrus Adamchik wrote:
    >
    >>
    >> On Jun 11, 2009, at 5:32 PM, Joe Baldwin wrote:
    >>
    >>> docs say that you can use either
    >>
    >> This can't be true... If you put org.objectstyle in the logging
    >> config, it will have zero effect in 2.0 and 3.0.
    >>
    >> Andrus
    >>
    >



    This archive was generated by hypermail 2.0.0 : Thu Jun 11 2009 - 11:40:48 EDT