This diagram shows the classes, properties and Nuget packages required for logging.
IFtpLogger
instance, which can be used with FluentFTP.Logging
to connect to the industry-standard ILogger
instance that can in turn integrate with any .NET logging framework. See the diagram below for a visual explanation. See this issue for the full design discussion.client.LegacyLogger - A property of FtpClient
. Assign this to a callback that will be fired every time a message is logged.
client.Config.LogToConsole - Should FTP communication be be logged to the console? Default: false.
client.Config.LogHost - Include server IP addresses in logs? Default: false.
true
: Status: Connecting to 123.123.123.123:21
false
: Status: Connecting to ***.***.***.***:21
client.Config.LogUserName - Include FTP usernames in logs? Default: false.
true
: Response: 331 Password required for jason_admin
false
: Response: 331 Password required for ***
client.Config.LogPassword - Include FTP passwords in logs? Default: false.
true
: Command: PASS supersecretST@nKS
false
: Command: PASS ***
client.Config.LogDurations - Include FTP command roundtrip duration in the logs? Default: true.
true
: Response: 150 File not found [5 sec]
false
: Response: 150 File not found
You can use any logging framework that creates a MELA ILogger instance, such as:
You can even use other frameworks not listed here, but then you will have to write a small wrapper function yourself.
How do I trace FTP commands for debugging?Do this after creating your FtpClient:
client.Config.LogToConsole = true;
Alternatively:
client.LegacyLogger
to get a callback every time a message is logged in the context of an individual FtpClient
instance.client.Logger
You can use any logging provided to help you log to a file. You then have to set this ILogger instance provided by your logging framework into our FTP Client's Logger
property.
Use these settings to control what data is included in the logs:
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4