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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T01:19:17+00:00 2026-06-06T01:19:17+00:00

I have this scala application which is very simple . All that it does

  • 0

I have this scala application which is very simple . All that it does is initializes a logger and does a logger.info(“Hello”). I have a log4j.properties file in the class path that has the following settings

# Root logger option
log4j.rootLogger=INFO, stdout

# Direct log messages to stdout
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.Target=System.out
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=%d{ABSOLUTE} %5p %c{1}:%L - %m%n

However, when I try to run the application. I get the error
log4j:WARN No appenders could be found for logger (app.TestApp$).
log4j:WARN Please initialize the log4j system properly.

What am I missing ? However, I get the logs printed out if I have hadoop-core.jar in the classpath (yeah there is a log4j inside it as well)

  • 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-06-06T01:19:18+00:00Added an answer on June 6, 2026 at 1:19 am

    Your log4J configuration file isn’t in the classpath, even if you think it is.
    The easiest way to solve this problem is to add -Dlog4j.debug to the VM parameters, then Log4J will trace the algorithm it is using to find its configuration:

    scala -cp {yourclasspath} -Dlog4j.debug {yourscalaentrypoint}
    

    Unfortunately @Jens’ answer won’t help you when you’re running a Scala program since Scala doesn’t use the standard Java system property to store its classpath. When you need to print out the classpath used for the Scala program you should use something like this technique.

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

Sidebar

Related Questions

Scala programmer should have known that this sort of writing : class Person{ var
I have a Scala application that relies on an external RESTful webservice for some
I have an Android application that is very image intensive. I'm currently using Bitmap.createScaledBitmap()
I have a simple web application in which I have created a wizard, each
I have this method: scala> def foo(traversable: Traversable[{def toByte: Byte}]) = { | traversable.map(_.toByte)
I'm learning Scala, so this is probably pretty noob-irific. I want to have a
Have this self-made slider: http://jsfiddle.net/wyc3P/4/ What it does: takes min and max values in
I have a currently running PHP application that I want to add real-time feed
I have an Android Bluetooth application which manages a couple of remote devices( Capsules
Lets say I have an already functioning Play 2.0 framework based application in Scala

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.