log4j for applet

Posted on 2005-04-01
Medium Priority
Last Modified: 2008-02-01

How can I direct log4j output to the java console? Where and how do I keep and access the property file for this to happen?
Question by:rakhare
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
LVL 86

Accepted Solution

CEHJ earned 300 total points
ID: 13682889
You need a ConsoleAppender. You can't hope to use log4j without reading the manual. Here's the short one:


Author Comment

ID: 13702431

Ok, I read it all.

Now here's what I did:

1. I put the log4j jar file in the root of my applet classes
2. Compiled all with the jar file in the classpath
3. When I run the applet, I get the following:

      at java.awt.EventQueue.invokeAndWait(Unknown Source)
      at org.bmc.misu.md.cms.PresentationServices.MainApplet.init(MainApplet.java:18)
      at sun.applet.AppletPanel.run(Unknown Source)
      at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.NoClassDefFoundError: org/apache/log4j/BasicConfigurator

What is it?
LVL 86

Expert Comment

ID: 13716054

Make sure log4j.jar is in the applet's archive tag

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

An old method to applying the Singleton pattern in your Java code is to check if a static instance, defined in the same class that needs to be instantiated once and only once, is null and then create a new instance; otherwise, the pre-existing insta…
Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
Viewers learn about the third conditional statement “else if” and use it in an example program. Then additional information about conditional statements is provided, covering the topic thoroughly. Viewers learn about the third conditional statement …
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.
Suggested Courses
Course of the Month8 days, 16 hours left to enroll

764 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question