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

  • Home
  • SEARCH
  • 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 3424888
In Process

The Archive Base Latest Questions

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

I want to config my logging system based on slf4j and log4j . I

  • 0

I want to config my logging system based on slf4j and log4j. I want to log all messages from com.A class. And only those messages.

so I wrote in my config file

log4j.rootLogger=FATAL, All
log4j.rootLogger=DEBUG, A1
log4j.appender.A1=com.A
log4j.appender.Console=org.apache.log4j.ConsoleAppender
log4j.appender.Console.layout=org.apache.log4j.PatternLayout
log4j.appender.Console.layout.conversionPattern=%m%n

My runner (com.Start class) contains

PropertyConfigurator.configure("log4j.properties");

But when I start application I get

log4j:ERROR A "com.A" object is not assignable to a "org.apache.log4j.Appender" variable.
log4j:ERROR The class "org.apache.log4j.Appender" was loaded by 
log4j:ERROR [sun.misc.Launcher$AppClassLoader@d9f9c3] whereas object of type 
log4j:ERROR "com.A" was loaded by [sun.misc.Launcher$AppClassLoader@d9f9c3].
log4j:ERROR Could not instantiate appender named "A1".
log4j:WARN No appenders could be found for logger (com.Start).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.

Where’s my error?

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-18T06:31:42+00:00Added an answer on May 18, 2026 at 6:31 am

    Your configuration file isn’t properly written.

    Appender shouldn’t be the class/package deceleration but a type of appender you would like to output messages to (leave it blank if you wish to output to the default appender)
    The file should look more like:

    log4j.rootLogger=FATAL 
    log4j.logger.com.A=DEBUG
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to change the logging level of an application (ruby). require 'logger' config
I want to ignore some of my files (/config/environments/production.rb , /webrat.log , /config/database.yml ).
I want duration to be configurable from Web.config file, so user can alter the
i want log linenumber to my log file, using log4net.the config details of log4net
We use the caching and logging application blocks from entlib 4.1. We want to
I am logging messages using Enterprise Library. I want some of these (typically errors
I am trying to prevent the app log messages from going out to STDOUT
I want to configure IIS 7 logging options (log file format, request fields included,
I want to add logging to an application I am developing, using apache log4j.
We use java.util.logging, and we use java.util.logging.FileHandler to config the rotated logs. We want

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.