Announcement Announcement Module
No announcement yet.
JDK1.4 Logging Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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,

  • #2
    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


    • #3
      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:
      as specified in
      How would I set up this System property file in the Spring applicationContext.xml file?


      • #4
        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.