Our Products:   CompleteFTP  edtFTPnet/Free  edtFTPnet/PRO  edtFTPj/Free  edtFTPj/PRO
0 votes
14.6k views
in Java FTP by
I have the following code implemented, it creates the file, but never writes anything to it. In addition, it does not log to the screen. Please help...

Logger.setLevel(Level.ALL);
Logger.addAppender(new FileAppender("C:\\ttt.txt"));
Logger.addAppender(new StandardOutputAppender());

11 Answers

0 votes
by (162k points)
Aha, (our) problem solved. If you are using log4j, all bets are off - you need to configure it correctly, i.e. supply a log4j configuration file. Check the log4j documentation.

If you want to use the edtFTPj logging system, remove all the log4j imports.

Try playing with the demo code - it works.

Should I be able to log to a file and the screen without using log4j? If so, when I remove the line

System.setProperty("edtftp.log.log4j","true");

it still does not log to the screen or file. If I remove the line

Logger.addAppender(new FileAppender("C:\\ttt.txt"));

It does not log to the screen, only when I remove both addAppender lines does it log to the screen...

Categories

...