The java program in question keeps a single VM (java 1.5) up and running, and each thread is dedicated to a specific transmission method (e.g. FTP Send, HTTPS POST, etc.) and we have a configurable number of threads per type. For each data file sent, we actually start/stop sessions on different threads to different ftp sites, etc; logging is done by each EDT FTP thread, so each may start FileAppenders to a Logger within milli-seconds of each other. We sometimes get log info/debug from other threads in the wrong "temp" log... We send thousands of files to our customers every day and unfortunately must have some evidence that the file was properly transmitted to them.
We have tried the following in the code... i.e. using a unique "session-id" concept:
// Create an EDT debug logger to append to the regular log file
if (myLog.getCurrentSessionID() > -1) {
ftpLogger = com.enterprisedt.
util.debug.Logger.getLogger(this.getClass().getName() +
myLog.getCurrentSessionID());
} else {
ftpLogger = com.enterprisedt.
util.debug.Logger.getLogger(this.getClass());
}
ftpLogger.setLevel(Level.DEBUG);
Appender logAppender = new FileAppender(myLog.getFullName());
ftpLogger.addAppender(logAppender);
Sample output:
DEBUG [com.enterprisedt.net.ftp.FTPClient] 1 May 2007 06:21:10.94 : Class: com.enterprisedt.net.ftp.ssl.SSLFTPClient
Version: 1.2.8
Build timestamp: 24-May-2006 12:04:20 EST
Java version: 1.5.0_08
CLASSPATH: c:\ASPCORE\thirdparty\jintegra\lib\jintegra.jar;C:\oracle\ora92\jdbc\lib\ojdbc14.jar;C:\Dev Library Jars\ecpcore.jar;c:\ASPCORE\thirdparty\JavaMail\mail.jar;c:\ASPCORE\thirdparty\JavaMail\activation.jar;c:\ASPCORE\THIRDPARTY\ChaseBank\ChaseBank.jar;C:\Dev Library Jars\EDT\edtftpj-pro.jar;C:\Dev Library Jars\EDT\license.jar;c:\ASPCORE\thirdparty\ORO\NetComponents.jar;.;C:\Program Files\Java\jre1.5.0_09\lib\ext\QTJava.zip
OS name: Windows XP
OS arch: x86
OS version: 5.1
INFO [com.enterprisedt.util.license.LicenseProperties] 1 May 2007 06:21:10.94 : Licence expiry date: 31 Dec 2099
INFO [com.enterprisedt.util.license.LicenseProperties] 1 May 2007 06:21:10.94 : Production licence
DEBUG [com.enterprisedt.net.ftp.ssl.SSLFTPClient] 1 May 2007 06:21:10.94 : Setting custom validator to com.enterprisedt.net.ftp.ssl.SSLFTPStandardValidator
INFO [com.ecpower.comm.FTPWrapper85] 1 May 2007 06:21:10.94 : Using FTP protocol Note: The 85 is the session ID used during creation
05/01-06:21:10.85: FTPWrapper(1.2): Making connection
DEBUG [com.enterprisedt.net.ftp.ssl.SSLFTPClient] 1 May 2007 06:21:10.94 : Created explicit FTPS client.
DEBUG [com.enterprisedt.net.ftp.ssl.SSLFTPClient] 1 May 2007 06:21:10.109 : Connecting to /10.10.11.120:21
DEBUG [com.enterprisedt.net.ftp.FTPControlSocket] 1 May 2007 06:21:10.125 : 220 test.asp.ec-power.com - (L03) For Authorized Use ONLY
DEBUG [com.enterprisedt.net.ftp.FTPControlSocket] 1 May 2007 06:21:10.125 : DISABLE_CONTROL_SSL_CLOSURE=true
...
Is this what you were suggesting? Note that the INFO and DEBUG statements from the API don't have our session ID 85...
Dave