Repository navigation
Logging
- client.Logger - A custom
IFtpLoggerinstance, which can be used withFluentFTP.Loggingto connect to the industry-standardILoggerinstance 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.
-
client.Config.LogUserName - Include FTP usernames in logs? Default: false.
-
client.Config.LogPassword - Include FTP passwords in logs? Default: false.
You can use any logging framework that creates a MELA ILogger instance, such as:
Do this after creating your FtpClient:
client.Config.LogToConsole = true;Alternatively:
- You can hook onto
client.LegacyLoggerto get a callback every time a message is logged in the context of an individualFtpClientinstance. - You can set any ILogger compatible logger into
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.
Nuget packages required:
Usage:
using FluentFTP; // from NuGet package FluentFTP
using FluentFTP.Logging; // from NuGet package FluentFTP.Logging
var builder = WebApplication.CreateBuilder(args);
var logger = new LoggerConfiguration()
.MinimumLevel.Debug()
.WriteTo.File("logs/Net6Tester.txt", rollingInterval: RollingInterval.Day)
.CreateLogger();
client.Logger = new FtpLogAdapter(logger);Use these settings to control what data is included in the logs:
- client.Config.LogUserName - Log FTP user names?
- client.Config.LogPassword - Log FTP passwords?
- client.Config.LogHost - Log FTP server host/IP addresses?
- Auto Connection
- Auto Reconnection
- FTP(S) Connection
- FTP(S) Connection using GnuTLS
- FTP(S) Connection using BouncyCastle
- FTPS Proxies
- Custom Servers
- Custom Commands
- v40 Migration Guide