Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Additional Logging Levels #81

Closed
jblacker opened this issue May 4, 2017 · 3 comments · Fixed by #100
Closed

Additional Logging Levels #81

jblacker opened this issue May 4, 2017 · 3 comments · Fixed by #100

Comments

@jblacker
Copy link
Contributor

jblacker commented May 4, 2017

Currently when you attach a TraceListener to FtpTrace, everything is issued at the DEBUG level. Obviously, this is great for development and testing. However, in production when an error occurs it would be nice to log the errors and ignore the tracing messages.

I think the FtpTrace class would be greatly enhanced by simply adding levels so when a TraceListener is attached the logging can be filtered appropriately and errors can be handled by the appropriate people. When using the low-level APIs this isn't a big deal, but this is especially important when a failure occurs using the high-level APIs. For example, when using UploadFile() / DownloadFile(), there's no way to know what the failure if it returns false in production or in a release build.

Originally, I thought that maybe adding a "LastError" property to the FtpClient class would do the trick, but in a multi-threading environment this would be a nightmare. What are your thoughts?

@robinrodricks
Copy link
Owner

robinrodricks commented May 4, 2017

Dude, all of your ideas are great, but I would especially appreciate you help with a certain issue that I really can't fix. If you have time, could you check it out? Its really simple. Just open an FTP Client and create a folder with spaces (but on a FreeBSD Server, if you have one handy..) And then try using FluentFTP to GetListing() the stuff in that folder. It apparently doesn't work. See #27

And yes, the tracing could be done. If you can list down specific places in the code that need CRITICAL or ERROR traces then I guess I could change those, so it can be logged properly in a production environment.

@jblacker
Copy link
Contributor Author

jblacker commented May 4, 2017

I'd be happy to help implement some of these ideas, but wanted to post first since you're the library owner. I'll spin up a FreeBSD VM sometime next week and take a look. I was thinking the error traces could be added wherever the source is for a a method returning false.

@robinrodricks
Copy link
Owner

Sure, help is always appreciated.

jblacker pushed a commit to jblacker/FluentFTP that referenced this issue May 12, 2017
Created FtpTraceLevel enum and updated signatures in FtpTrace class.
Depreciated signatures that do not include FtpTraceLevel.  Updated
throughout project to include the approprate logging level.  Completes
enhancement robinrodricks#81
robinrodricks pushed a commit that referenced this issue May 15, 2017
Custom error handling for Multi-File transfer, post transfer verification/hashing, and more (implements #81 #83 #92)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants