Results 1 to 6 of 6

Thread: STS 3.0.0 Log4j vs SLF4J

  1. #1
    Join Date
    Aug 2006
    Location
    Arequipa-Peru / South America
    Posts
    2,796

    Default 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
    - Manuel Jordan

    Kill Your Pride, Share Your Knowledge With All
    The Fear Of The LORD Is The Beginning Of Knowledge, But Fools Despise Wisdom And Discipline. Proverbs 1:7

    Blog


    Technical Reviewer of Apress

    • Pro SpringSource dm Server
    • Spring Enterprise Recipes: A Problem-Solution Approach
    • Spring Recipes: A Problem-Solution Approach, 2nd Edition
    • Pro Spring Integration
    • Pro Spring Batch
    • Pro Spring 3
    • Pro Spring MVC: With Web Flow
    • Pro Spring Security

  2. #2
    Join Date
    Jun 2006
    Location
    The Netherlands
    Posts
    13,632

    Default

    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 )
    Marten Deinum
    Java Consultant / Pragmatist / Open Source Enthousiast / Author


    Pro Spring MVC: With Web Flow
    Conspect

    Have you read the reference guide.
    Use the [ code ] tags, young padawan

  3. #3
    Join Date
    Aug 2006
    Location
    Arequipa-Peru / South America
    Posts
    2,796

    Default

    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
    - Manuel Jordan

    Kill Your Pride, Share Your Knowledge With All
    The Fear Of The LORD Is The Beginning Of Knowledge, But Fools Despise Wisdom And Discipline. Proverbs 1:7

    Blog


    Technical Reviewer of Apress

    • Pro SpringSource dm Server
    • Spring Enterprise Recipes: A Problem-Solution Approach
    • Spring Recipes: A Problem-Solution Approach, 2nd Edition
    • Pro Spring Integration
    • Pro Spring Batch
    • Pro Spring 3
    • Pro Spring MVC: With Web Flow
    • Pro Spring Security

  4. #4
    Join Date
    Jun 2006
    Location
    The Netherlands
    Posts
    13,632

    Default

    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...
    Marten Deinum
    Java Consultant / Pragmatist / Open Source Enthousiast / Author


    Pro Spring MVC: With Web Flow
    Conspect

    Have you read the reference guide.
    Use the [ code ] tags, young padawan

  5. #5
    Join Date
    Aug 2006
    Location
    Arequipa-Peru / South America
    Posts
    2,796

    Default

    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?
    - Manuel Jordan

    Kill Your Pride, Share Your Knowledge With All
    The Fear Of The LORD Is The Beginning Of Knowledge, But Fools Despise Wisdom And Discipline. Proverbs 1:7

    Blog


    Technical Reviewer of Apress

    • Pro SpringSource dm Server
    • Spring Enterprise Recipes: A Problem-Solution Approach
    • Spring Recipes: A Problem-Solution Approach, 2nd Edition
    • Pro Spring Integration
    • Pro Spring Batch
    • Pro Spring 3
    • Pro Spring MVC: With Web Flow
    • Pro Spring Security

  6. #6
    Join Date
    Jun 2006
    Location
    The Netherlands
    Posts
    13,632

    Default

    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.
    Marten Deinum
    Java Consultant / Pragmatist / Open Source Enthousiast / Author


    Pro Spring MVC: With Web Flow
    Conspect

    Have you read the reference guide.
    Use the [ code ] tags, young padawan

Posting Permissions

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