Switching Java JDK - impact???
Hi,
I'm using F10 with the Java that came with it. And I'm stuck at something. I am devving an applet, served by a LAN server, the applet does a feedback tru the sys console Quote:
I tried log4j, but it depresses me :-( , and I also tried Java's own logger, it makes a logfile, but the applet (ran from the browser) does'nt write to it - security, of course... Tnx Thor (extra specs of my project available, just ask) |
I am not at all a Java guy, by why can't you write your diagnostic output to a file rather than to STDOUT, and then from any terminal do
Code:
less diagnostic_output.log Ot Java applets can't write to files directly, just to STDOUT/STDERR ? |
Hmm,
Lemme give that a "whack"... In fact, I was settled to the idea of having to read a file (using log4j?) or Java's own logger mech, but, as you aplty dotted out: applets cant do that. Ok, I can see the security holes in windows if and when a System.out CAN actually be read on the console, but Linux just HAS to have some other mechanism... As said, I'll have a close look at youe suggestions...thanks! Thor |
Quote:
I.e. I mean to send diagnostic output to socket. |
Hey, there is a thought! And I mean just that! The very idea, why not write a "thingie" in Perl, listening to the socket the applet sends to/tru/over?
Let me think "out loud" for a moment (it's 23:39 here, I just came out of the shower, just got back from work - so I'm not very lucid anymore :D ...) I'd write a little "void" (a function that does'nt give a value back) in Java that accepts a string, that void would write to a socket (never even attempted this before) that has a listener - on the same machine - in the shape of a Perl script. So every time I get an error (try/catch construct for example) I'd send the error message to the void-to the socket- to the Perl script- to a console. Can Perl do that (duh - my Perl knowledge is next-to-non-existend, so sorry about the question)??? Hey, and I REALLY mean that, big thanks!!! Thor (having a little more hope again) :D |
Quote:
http://www.perlfect.com/articles/sockets.shtml . Or/and enter Perl socket tutorial Perl socket programming , etc. into your favorite WEB search engine. |
So, this really works...now I have to figure out how to let this work in a browser. I've tried it in the IDE (appletviewer) and there it works perfectly, in a browser, I get an "applet not initialized"...
Security? Dunnow-yet... The tutorial helped. I'll send all the debug messages tru a socket, and read them in a nearby console... Again, thanks! Thor |
All times are GMT -5. The time now is 09:46 PM. |