Our Products:   CompleteFTP  edtFTPnet/Free  edtFTPnet/PRO  edtFTPj/Free  edtFTPj/PRO
0 votes
3k views
in Java FTP by (300 points)
I am using log4j-1.2.8 and edtftpj-2.0.0.

The log4j configuration is as follows,

log4j.logger.TRANSFER_FTP_LOGGER=DEBUG, R4
log4j.category.com.enterprisedt=DEBUG

log4j.appender.R4=org.apache.log4j.FileAppender
...


I set the -Dedtftp.log.log4j flag thru the code to true,
System.setProperty("edtftp.log.log4j", "true");


Then I try to get an instance of Logger,
edtLogger = com.enterprisedt.util.debug.Logger.getLogger("TRANSFER_FTP_LOGGER");


Stmts such as these are in the code,
edtLogger.debug("Connecting..."); --A
ftpClient = new FileTransferClient();
ftpClient.setRemoteHost(bundle.getString(Constants.REMOTE_HOST));
ftpClient.setUserName(bundle.getString(Constants.USERID));
ftpClient.setPassword(bundle.getString(Constants.PASSWORD));
ftpClient.connect();
edtLogger.debug("Connected to ftp server"); --B

When I run my code, it logs only those stmts that are in my class (i.e., A and B).
It does not log stuff from, say, FTPClient/FTPControlSocket/SocketUtils etc.

Am I missing anything that's causing this?

1 Answer

0 votes
by (162k points)
To start with try:

log4j.rootCategory=DEBUG, R4

Categories

...