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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T10:16:07+00:00 2026-05-18T10:16:07+00:00

I have a project using log4j. Now I have to introduce a library using

  • 0

I have a project using log4j. Now I have to introduce a library using slf4j. Can I ask slf4j to initialize itself based on log4j config? So I basicly want log4j as underlying library under slf4j.

UPDATE:

log4j config is like this:

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">

<log4j:configuration debug="true" xmlns:log4j="http://jakarta.apache.org/log4j/">
    <appender name="fileAppender" class="org.apache.log4j.rolling.RollingFileAppender">
        <param name="file" value="${log.dir}/${log.file}.log" />
        <param name="append" value="true" />
        <rollingPolicy class="org.apache.log4j.rolling.TimeBasedRollingPolicy">
            <param name="FileNamePattern" value="${archive.log.dir}/${log.file}.%d{yyyy-MM-dd}.gz" />
            <param name="ActiveFileName" value="${log.dir}/${log.file}.log"/>
        </rollingPolicy>
        <layout class="org.apache.log4j.EnhancedPatternLayout">
            <param name="ConversionPattern" value="%d{yyMMdd HH:mm:ss,SSS} [%t] %-5p %c %X %m%n" />
        </layout>
    </appender>
    <logger name="org.hibernate"> 
        <level value="ALL" /> 
        <appender-ref ref="fileAppender"/> 
    </logger> 
    <root>
        <priority value="info" />
        <appender-ref ref="fileAppender" />
    </root>
</log4j:configuration>

I also use apache-log4j-extras version 1.0.
log4j version is 1.2.16

  • 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-18T10:16:08+00:00Added an answer on May 18, 2026 at 10:16 am

    Yes, you need three jar files in your project’s classpath:

    slf4j-api-1.6.1.jar       // the slf4j API
    slf4j-log4j12-1.6.1.jar   // log4j bindings for slf4j
    log4j-1.2.15.jar          // log4j itself
    

    Make sure you have the same version of slf4j-api and slf4j-log4j12, otherwise it won’t work. You can also use the newest log4j version, 1.2.16 if I’m not mistaken.

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

Sidebar

Related Questions

I have a Spring project using log4j on Linux (Debian, Ubuntu and RHEL). Now
I have developed a web project. Which is generating log file using log4j. But
We have a project using FluentNibernate to map the entities. Now I need to
I have a project using Lucene3.5 already. Now i need to provide web search
I have deploy my project using project:deploy --go. Now i have my folders apps,
I have configured a project with Log4j. I have configured log4j using log4.properties file.
I have been told to use log4j for my logging project,but before using log4j,
I'm using eclipse and I have placed log4j.properties in the project directory and I
I have a project using common-logging and log4j , I want to change to
I have a project using DynamicJasper to create reports. It works fine so far,

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.