Announcement Announcement Module
Collapse
No announcement yet.
STS 3.0.0 Log4j vs SLF4J Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • STS 3.0.0 Log4j vs SLF4J

    Hello Guys

    I am just working with STS 3.0.0, it is fast
    (I have read rumors about 3.1.0 is slow due Eclipse problems performance)

    I have a question
    Why for a generated Spring Template Project it use Log4j and not SLF4J?
    I have read the second has some improvements about performance.

    Thanks in advanced

  • #2
    The Spring template project does use SLF4J (at least the Spring MVC one)... SLF4J is just a wrapper (like commons-logging) around different frameworks...

    Also 3.1 of STS isn't really slow only the Eclipse 4.x version, the 3.8 version is fine... (Eclipse 4.x is a PITA concerning performance :s )

    Comment


    • #3
      Hi Marten

      The Spring template project does use SLF4J (at least the Spring MVC one)... SLF4J is just a wrapper (like commons-logging) around different frameworks...
      Seems only for Spring MVC, because for the Spring Integration Simple template only use Log4j, none
      SLF4J dependency in the pom.xml appear

      Also 3.1 of STS isn't really slow only the Eclipse 4.x version, the 3.8 version is fine... (Eclipse 4.x is a PITA concerning performance :s )
      I will test it to get my own conclusions.

      Kind Regards

      Comment


      • #4
        Just created a project and there is no logging at all in the generated classes. So I suspect that the only need for log4j is so that there is some output. Commons-logging already comes in as a dependency for spring-core.

        It also dependends on an older version (3.0) of spring, so that needs an upgrade to...

        Comment


        • #5
          Hi Marten

          Just created a project and there is no logging at all in the generated classes.
          I am working with STS 3.0.0, I just checked my two Spring Integration Simple templates projects, and for both, they have the Main class and ..

          Code:
          package com.manuel.jordan;
          
          import java.util.Scanner;
          
          import org.apache.log4j.Logger;
          import org.springframework.context.support.AbstractApplicationContext;
          import org.springframework.context.support.ClassPathXmlApplicationContext;
          
          import com.manuel.jordan.service.StringConversionService;
          
          
          /**
           * Starts the Spring Context and will initialize the Spring Integration routes.
           *
           * @author Your Name Here
           * @version 1.0
           *
           */
          public final class Main {
          
          	private static final Logger LOGGER = Logger.getLogger(Main.class);
          
          	private Main() { }
          
          	/**
          	 * Load the Spring Integration Application Context
          	 *
          	 * @param args - command line arguments
          	 */
          	public static void main(final String... args) {
          
          		if (LOGGER.isInfoEnabled()) {
          			LOGGER.info("\n========================================================="
          					  + "\n                                                         "
          					  + "\n          Welcome to Spring Integration!                 "
          					  + "\n                                                         "
          					  + "\n    For more information please visit:                   "
          					  + "\n    http://www.springsource.org/spring-integration       "
          					  + "\n                                                         "
          					  + "\n=========================================================" );
          		}
          ...
          So I suspect that the only need for log4j is so that there is some output.
          Seems a contradiction with your first sentence, in blue above

          Yes, for this case, the Main class.
          I think in STS 2.9.1 logging was included in some pre defined service classes.

          It also dependends on an older version (3.0) of spring, so that needs an upgrade to...
          Agree.

          Tell me, this happen in your STS 3.1.0?

          Comment


          • #6
            Seems a contradiction with your first sentence, in blue above
            Well you didn't tell which project . I created a Simple Spring Utility Project which doesn't have any logging in the methods...

            Just checked the one you used and that indeed has logging and directly with log4j.

            Comment

            Working...
            X