Our Products:   CompleteFTP  edtFTPnet/Free  edtFTPnet/PRO  edtFTPj/Free  edtFTPj/PRO
0 votes
3.1k views
in .NET FTP by (140 points)
Hi,


Just want to know how editFTPnet enable logging. I want to see the actual log of editftpnet somehow. thanks

3 Answers

0 votes
by (51.6k points)
All commands sent to the FTP server and subsequent replies are logged, and can be made available on the console or directed to a log file. Much other useful information is also logged.

Statements within edtFTPnet/PRO are logged at different levels, ranging from least verbose (Fatal) to most verbose (Debug). Intermediate levels are Error, Warning and Information. An overall level can be set for the library, and all statements up to and including that level will be outputted.

For example, if the overall level is set to Information, then Fatal, Error, Warning and Information log statements will be outputted, but Debug statements will not be.

There are also two additional levels that can be conveniently used - None, which means no logging will occur, and All, which means all log statements will be outputted, no matter what level they are. The All level is actually an additional level which is used for extremely verbose output - so when the level is set to All more log statements may be outputted than at Debug.

The overall level can be set via the static LogLevel property:
FTPConnection.LogLevel = LogLevel.Information;


The destination for logging can be set via several properties, described below:
  • LogToConsole If set to true, logging is directed to the console
  • LogToTrace If set to true, logging is directed to .NET's Trace facility
  • LogFile If to a valid filename, logging is directed to the file
An application configuration setting, edtftp.log.level, can also be used to set the logging level from the configuration file (in the appSettings section).

For example, the following configuration could be used to set the global logging level to Information:
<configuration>
   <appSettings>
      <add key="edtftp.log.level" value="Information"/>    
   </appSettings>
</configuration>


This application setting will be overridden by explicitly using the LogLevel property.
0 votes
by (320 points)
I'm playing with the different log levels and am wondering if there is one specific to just FTP commands. We plan on using the component in an automated fashion, and would like to log just the FTP commands, while allowing our normal exception management systems to handle exceptions. The log is more for FTP confirmation then troubleshooting.

Right now I have the log set to ALL and I get the details we want with some extra details about the component. It will work, but if there is a way to only get the FTP output that would be ideal.

Thanks

Aaron
0 votes
by (162k points)
Sure, look at the CommandSent and ReplyReceived events, they capture FTP commands and replies.

Categories

...