Latest LQ Deal: Linux Power User Bundle
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 04-18-2009, 07:52 AM   #1
Senior Member
Registered: Nov 2007
Location: Somewhere on my hard drive...
Distribution: Manjaro
Posts: 2,686
Blog Entries: 23

Rep: Reputation: 398Reputation: 398Reputation: 398Reputation: 398
Log4j anyone???


I need some logging mechanism in my Java development. The dev setup is as follows (just to give you an idea) server CentOS 5.2 with java 1.6, PHP and mySQL on the one end, and Fedora 10, (openJDK?) on the dev side. Ok, so I have a website on the server that I "surf" to (entering the IP address - life CAN be simple) and call up an info page that is on the server...not. I get a blank page - applet (possibly) crashed on me...

Result: I need to log what the applet screams before it dies on me, enter log4j.

Just to test, this is what I "fumbled" up as test applet:

import java.awt.*;
import java.applet.*;
import org.apache.log4j.Logger;

* @author t01dev
public class Ploop extends Applet
// declare some stuff here
Logger myLogger = Logger.getLogger("Ploop");

public void init()


public void paint(Graphics g)
g.setColor(new Color(100,45,14));
g.drawString("Ploop rules!", 10, 10);

with this as HTML:

<title>Ploop test</title>
<APPLET CODE="Ploop.class" name="plooptest" WIDTH=400 HEIGHT=100>
the browser (firefox - of course) says "applet not initialised" in the status bar...

What? Where? Huh???

Please help, tnx

Old 04-18-2009, 01:34 PM   #2
LQ Guru
Registered: Mar 2004
Distribution: SusE 8.2
Posts: 5,863
Blog Entries: 1

Rep: Reputation: Disabled
Hi -

Log4J is great for debugging server-side stuff ... but frankly, I'd just use a simple "MsgBox" popup on your (applet) client:

import java.awt.*;
Old 04-19-2009, 12:37 PM   #3
Senior Member
Registered: Nov 2007
Location: Somewhere on my hard drive...
Distribution: Manjaro
Posts: 2,686
Blog Entries: 23

Original Poster
Rep: Reputation: 398Reputation: 398Reputation: 398Reputation: 398

Hmmmpfff...after H-O-U-R-S of skimming tru tons of lecture, it's possibly the better sollution.

Too bad, If I had a java console as promissed by FireFox's extentions...but that does'nt work. I have "java console" in the tools menu, but nothing happens, so I am/was looking for some way to log an applet...

Eh, who said life is sweet...did'nt try setting up log4j...

Enjoy what is left of your weekend, I will



applet, java, log4j, logging

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
SVNKit+log4j conflict kpachopoulos Programming 0 10-23-2007 04:13 AM
configure syslog with log4j y2j_2062 Linux - Software 1 04-01-2007 01:14 AM

All times are GMT -5. The time now is 05:16 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration