Results 1 to 4 of 4

Thread: JDK1.4 Logging

  1. #1
    Join Date
    Aug 2004
    Posts
    5

    Default JDK1.4 Logging

    How do I configure Spring to use JDK 1.4 logging? I prefer not to use log4j since that we use JDK1.4 logging at our company. Spring uses log4j by default.

    Thanks in adavnce,
    Femi

  2. #2
    Join Date
    Aug 2004
    Location
    Montréal, Canada
    Posts
    845

    Default

    Spring uses Jakarta Commons Logging. The later uses log4j if it is found in your classpath.
    Since you use JDK1.4, just remove log4j.jar from your classpath, and JCL will use JDK logging.
    For more information take a look at http://jakarta.apache.org/commons/lo...#Configuration
    Omar Irbouh

    Spring Modules Team
    http://irbouh.blogspot.com/

  3. #3
    Join Date
    Aug 2004
    Posts
    5

    Default

    I auto-generate my class path to add all jar files within a directory to my class path and I'd rather keep my log4j.jar file there. I think one can set a property to specify which kind of logging to use with this system property:
    java.util.logging.config.class
    as specified in http://java.sun.com/j2se/1.4.2/docs/...LogManager.htm
    How would I set up this System property file in the Spring applicationContext.xml file?

  4. #4
    Join Date
    Aug 2004
    Location
    Toronto, Canada
    Posts
    736

    Default

    You can't set the system property from Spring itself, since it will be too late. (Thsi is assuming the appserver security environment even let's you set system properties). Spring will have already tried to log something, so log4j will have been initialized.

    If you can not modify your appserver environment to just start up the appserver with this property already set, what you could try doing is setting the system property in a web app context loader listener which is registered to be the first one loaded, when your webapp loads.
    Colin Sampaleanu
    SpringSource - http://www.springsource.com

Similar Threads

  1. Newbie question: How to get spring debug logging on?
    By wangjammer5 in forum Container
    Replies: 2
    Last Post: Jul 15th, 2005, 07:11 AM
  2. Log4j, Commons Logging in JRun 4 problem
    By virgo_ct in forum Container
    Replies: 4
    Last Post: Jul 13th, 2005, 04:17 AM
  3. Setting logging level to Debug in Spring
    By fineman in forum Container
    Replies: 2
    Last Post: Jul 8th, 2005, 09:31 AM
  4. logging configuration question
    By pdemilly in forum Container
    Replies: 3
    Last Post: Jan 22nd, 2005, 06:48 AM
  5. Logging best practices?
    By dekker in forum Container
    Replies: 1
    Last Post: Dec 6th, 2004, 09:12 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •