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 7023259
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T23:41:18+00:00 2026-05-27T23:41:18+00:00

I’ve below code in Java 1.6: import org.slf4j.Logger; import org.slf4j.LoggerFactory; private static Logger log

  • 0

I’ve below code in Java 1.6:

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

private static Logger log = LoggerFactory.getLogger(myfile.class);

Now, I put the slf4j-api-1.6.4.jar & slf4j-simple-1.6.4.jar in classpath & code compiles fine but where is it logging all the information????

I’ve log.info(“test”); but its not creating any log file. I tried creating log4j.properties with below content:

log4j.appender.stdout=org.apache.log4j.RollingFileAppender
log4j.appender.stdout.File=/var/abc.log
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=[%d{dd-MMM-yyyy HH:mm:ss}]%6p %c{1}:%L - %m%n
log4j.appender.stdout.MaxFileSize=50000KB
log4j.appender.stdout.MaxBackupIndex=200

log4j.rootLogger=info, stdout

But its not working, I know above file is required for log4j but how does slf4j works?? Do I need to create any properties file similar to log4j?? If so, where do I need to put it?

Thanks!

  • 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-27T23:41:19+00:00Added an answer on May 27, 2026 at 11:41 pm

    SLF4J is just a façade which allows you to switch different logging frameworks easily .All the logging calls using SLF4J API will be delegated to the underlying logging framework .

    You don’t have to create any properties file for SLF4J .All you need to do is use the correct “SLF4J bindings” jar that matches your logging frameworks in order to delegate all the logging calls of the SLF4J API to the underlying logging framework . The following picture shows the relationship between SLF4J , “SLF4J bindings” , and the underlying logging frameworks

    enter image description here

    slf4j-simple-1.6.4.jar delegates all events to System.err , but not delegates to log4j API.So , you should use slf4j-log4j12-1.6.4.jar instead.

    To summarizes, you should use the following jars:

    • slf4j-api-1.6.4.jar
    • slf4j-log4j12-1.6.4.jar
    • log4j-1.2.16.jar

    Reference

    • SLF4J user manual
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString
public static bool CheckLogin(string Username, string Password, bool AutoLogin) { bool LoginSuccessful; // Trim
Does anyone know how can I replace this 2 symbol below from the string
I have thousands of HTML files to process using Groovy/Java and I need to
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I ran into a problem. Wrote the following code snippet: teksti = teksti.Trim() teksti
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
That's pretty much it. I'm using Nokogiri to scrape a web page what has

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.