0 votes
by (640 points)
edited

Can I configure Ftp/Sftp tracing via application configuration file, w/o modifying code and recompiling application?

Of course, I can write my own LogWriter, that uses a TraceSource, and setup it for any Ftp/Sftp object I've created; but, in my view, this is common and useful scenario.

1 Answer

0 votes
by (13.0k points)
edited

Hello,

adding a new LogWriter which will log to TraceSource looks to be a good idea. We will add it to one of future versions. Thanks for the suggestion.

Adding an ability to turn on logging by just updating config is tempting too. However it may have some undesirable side effect:

  • Some (paranoid?) dev's may feel a bit tricked when our component starts reading the config file without being asked.

  • Some dev's may be unhappy when the admin or app user can turn on logging by updating config files. For example passwords can be retrieved from Verbose logs. And updating logfile is easier than installing the packet capture software.

Both concerns can be addressed if programmer is required to explicitly state that logger configuration should be read from the config file. Something like this:

Ftp.LogWriter = LogWriterHelper.ReadFromConfig()

or by adding an attribute to assembly - similar to Log4Net XmlConfigurator attribute:

[assembly: Rebex.Configuration.XmlLogWriterConfigurator(Watch = true)]

What do you think? Would it be ok for you?

...