How to debug this applet ?

Display/storage of the debug message

The UploadPolicy contains a displayDebug method. This method :
  • Displays the message on the status bar (on the bottom of the applet), if the current debugLevel is greater or equals to the level given to this method. To have no debug output, put this applet parameter to 0 ... or omit debugLevel, as 0 is the default level. 100 is the maximum debugLevel. As I didn't documente nor really manage the different values of this level... Let's say you may have 0 or 100 (debug off or on).
  • Regardless of the log level, messages are always stored in a temporary log file (since version 2.9.2rc4). This file is named "jupload_xxxxx_log.txt" where xxxxx is a uniqe number and located in the platform-dependant temp directory. It is deleted upon VM exit.
  • Getting the debug output

    The code contains a lot of calls to the displayDebug method. To retrieve the output generated by these calls:
  • If you are in debug mode, you can copy the full status area, to get the recent lines of debug output. In order to save memory, the status area is limited to 1000 lines.
  • If not in debug mode and the parameter urlToSendErrorTo is set, then - if a fatal error occurs - the user will be asked to submit the full log (from the log file). If she agrees, the applet will send the log to the specified URL using an HTTP POST. This allows you to log the error, send a mail to the webmaster or do whatever processing you want on the server side.
  • Changing the debug level

    There are two ways to do this:
  • Change the server configuration: give the debugLevel applet parameter, in the applet tag. Put this parameter to 100, to get the full debug output.
  • Change the applet configuration, once it is started (since 2.5). I've hidden this functionnality, to prevent user to activate this by error. Here is the way to activate the full debug output: Right-Click on the file liste (since 2.9.0) or the status area, while holding the CTRL key down. This should open a popmenu: select the 'debug on' entry. Doing so switch the debug on and off. If the status area was hidden (with the showStatusBar applet parameter), it will become visiblen when debug is put on.