Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6769251
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T15:10:14+00:00 2026-05-26T15:10:14+00:00

Please, take a look at this example: import org.slf4j.Logger; import org.slf4j.LoggerFactory; public class Test

  • 0

Please, take a look at this example:

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class Test {
   public static void main(String[] args) {
      Logger log = LoggerFactory.getLogger(Test.class);
      log.info("Hello World");
   }
}

The program generates following output:

2011-11-01 13:06:05 Test main
INFO: Hello World

How to get rid of the first line? How to set Logger not to show methods invocations?

slf4j uses jdk14 in my application. In addition, I have two handlers, so it would be nice if there would be a way to disable methods invocations logging just for one handler.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T15:10:15+00:00Added an answer on May 26, 2026 at 3:10 pm

    The two lines are both generated by the call to log.info. It seems the logger implementation default format generates line breaks. In no way “method entry” itself produces any output.

    To make it clear: If you log twice as in

    log.info("Hello World1");
    log.info("Hello World2");
    

    I expect this output:

    2011-11-01 13:06:05 Test main
    INFO: Hello World1
    2011-11-01 13:06:05 Test main
    INFO: Hello World2
    

    Oh, and the general way to setup Java-Util-Logging for your JDK is described here:

    http://download.oracle.com/javase/1.4.2/docs/guide/util/logging/overview.html

    You will have to look out the “Formatters” section and implement your own formatter (AFAIK). Or simply use a usable logging implementation behind slf4j like logback or log4j.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Please take a look at this example: #include <iostream> #include <vector> #include <string> using
Please take a look at this code: template<class T> class A { class base
Please consider this example class: [Serializable] public class SomeClass { private DateTime _SomeDateTime; public
Please take a look at this very short example fieldset, legend, .TLabel, .TComboBox, .select,
please take a look of this, the file demo.php is an example of the
Before I ask my question, please take a look at this example function: DateTime.TryParse(01/01/2000,
Please take a look at this spider example in Scrapy documentation. The explanation is:
Please take a look at this link: Random entry from dictionary That example is
Please take a look on the following example: class Base { protected: int m_nValue;
Please take a look at this example. http://jsfiddle.net/LdeWK/2/ I want to know how to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.