You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@pivot.apache.org by JohnRodey <ti...@yahoo.com> on 2010/06/21 15:48:55 UTC

Standard practice for logging from applet

When most people develop with applets how do they handle logging?  I want
them stored on the server side so my initial instinct is to use a
SocketAppender to write the traces back to the server.  I imagine that I
also want to somehow split the log files based on the session, so that
multiple simultaneous users are not altering the same log file.  Any other
thoughts?

I guess I'm just trying to figure out if I'm way off base since I've never
done any web-based GUI's before.
-- 
View this message in context: http://apache-pivot-users.399431.n3.nabble.com/Standard-practice-for-logging-from-applet-tp911517p911517.html
Sent from the Apache Pivot - Users mailing list archive at Nabble.com.

Re: Standard practice for logging from applet

Posted by JohnRodey <ti...@yahoo.com>.
Ya that's pretty much the approach I am looking at taking.

Log4J log() on the applet using a SocketAppender.  Initially running the
SocketServer as a separate process and then integrating it in as a process
managed by my Tomcat server.  The SocketServer will log everything to a
rolling file on the server side.  I will still keep a second appender for
everything to log to the console where the code is running.  Log4J will
handle threading so that there is no slow down to my applet.

Thanks
-- 
View this message in context: http://apache-pivot-users.399431.n3.nabble.com/Standard-practice-for-logging-from-applet-tp911517p912687.html
Sent from the Apache Pivot - Users mailing list archive at Nabble.com.

Re: Standard practice for logging from applet

Posted by Sandro Martini <sa...@gmail.com>.
Hi to all,
probably you should use a standard library for logging, like Log4J or SLF4J
(+opt. Log4J), and configure them to write logs to a network server (for
example a syslog server on UNIX), and maybe in an asynchronous way to avoid
slow down your applets. Or better, write on multiple destinations, like to
the Applet Console and the remote system.

Otherwise you shod log using the Java (integrated) logging (that's not the
best, all say this ...), but this is a little trick: 
http://java.sun.com/javase/6/docs/technotes/guides/deployment/deployment-guide/tracing_logging.html

Instead, to write on the local file system you need signed jars ...

I hope this is enough to start make some experiments, otherwise tell me.
Probably this could be another simple but interesting demo/tutorial for
Pivot (at least using the integrated Java Logging).

Bye,
Sandro

-- 
View this message in context: http://apache-pivot-users.399431.n3.nabble.com/Standard-practice-for-logging-from-applet-tp911517p912006.html
Sent from the Apache Pivot - Users mailing list archive at Nabble.com.

Re: Standard practice for logging from applet

Posted by Greg Brown <gk...@mac.com>.
Great question. I'm probably not a good example since I generally use System.out. I wonder if any of the various logging frameworks might have something you could use. 

On the other hand, network logging could be expensive. I assume your application talks to some kind of web service? Perhaps you could perform logging in the web tier, since that requires a network round trip anyways?


On Jun 21, 2010, at 9:48 AM, JohnRodey wrote:

> 
> When most people develop with applets how do they handle logging?  I want
> them stored on the server side so my initial instinct is to use a
> SocketAppender to write the traces back to the server.  I imagine that I
> also want to somehow split the log files based on the session, so that
> multiple simultaneous users are not altering the same log file.  Any other
> thoughts?
> 
> I guess I'm just trying to figure out if I'm way off base since I've never
> done any web-based GUI's before.
> -- 
> View this message in context: http://apache-pivot-users.399431.n3.nabble.com/Standard-practice-for-logging-from-applet-tp911517p911517.html
> Sent from the Apache Pivot - Users mailing list archive at Nabble.com.