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

Can I enable debugging for a connection to without showing my user DEBUG [LicenseProperties] events. I do want my debug log file to contain only Connection specific information. Please help.

Thanks

10 Answers

0 votes
by (162k points)
Can you elaborate a little - perhaps post an excerpt of a log file and indicate what you don't want.
0 votes
by (700 points)
Hi,

Here is an excerpt:

DEBUG [FTPControlSocket] 9 Dec 2008 00:50:18.250 : Setting socket timeout=60000
DEBUG [FTPControlSocket] 9 Dec 2008 00:50:18.265 : Command encoding=System.Text.ASCIIEncoding
DEBUG [ExFTPControlSocket] 9 Dec 2008 00:50:18.265 : Created control-socket: SocksContext=, ProxySettings=NoProxy, RemoteHost=10.0.0.5, controlPort=21, timeout=60000
DEBUG [FTPControlSocket] 9 Dec 2008 00:50:18.265 : StrictReturnCodes=False
DEBUG [LicenseProperties] 9 Dec 2008 00:50:18.328 : Looking for subkey Software\Enterprise Distributed Technologies\edtFTPnet Express (fallback Software\Enterprise Distributed Technologies\edtFTPnet PRO)
DEBUG [LicenseProperties] 9 Dec 2008 00:50:18.328 : Found license subkey Software\Enterprise Distributed Technologies\edtFTPnet Express


I wish to not include any entries related to the license infotmation such as the ones highlighted..
0 votes
by (51.6k points)
I suggest you extend EnterpriseDT.Util.Debug.FileAppender and override void Log(string msg) with something like this:
public override void Log(string msg)
{
    if (!msg.Contains("LicenseProperties"))
        base.Log(msg);
}

Then add that appender and voila.

- Hans (EnterpriseDT)
0 votes
by (700 points)
Perfect Hans.. Thanks a lot.

Cheers
0 votes
by (700 points)
Hi Hans,

Well, I am using VB.net and got mixed up trying to do that. What do you mean by extend EnterpriseDT.Util.Debug.FileAppender? I am inheriting the EXFTPconnection into my custom class. Then I set the debug level to DEBUG. Where should I override the method you referred to below?

Thanks
0 votes
by (51.6k points)
Public Class MyAppender
    Inherits FileAppender
    Public Overloads Overrides Sub Log(ByVal msg As String)
        If Not msg.Contains("LicenseProperties") Then
            MyBase.Log(msg)
        End If
    End Sub
End Class


- Hans (EnterpriseDT)
0 votes
by (700 points)
Thanks.. I needed to assign this file appender to my custom FTPconnection class. With some research I found out how to do it:
Logger.CurrentLevel = Level.ALL
Logger.AddAppender(New MyAppender(LogFilePath))


One more question here please. How do you control the logfile size to prevent performance degradation if the file gets too big. In Log4net you do that by settings directives in the config section in the app.config I suppose. Is there a way to do that in your classes?

Thanks
0 votes
by (162k points)
You can't do that currently, although it would be quite easy to write a RollingFileAppender, I think.

We should probably do this. Let us know if you'd like to try it out.

The other alternative is to use a cron job or equivalent to periodically clear out the logs. You probably will end up doing something like this anyway just to prevent ever increasing disk space usage from log files.
0 votes
by (700 points)
Too bad. But sure I'd like to try that out.

About the cron job, I don't think this will work because the log files are locked as long as the application is running. It can be done at startup or at shutdown. Still I think that won't be sufficient for applications that for operational reasons should be running for extended period of time.
0 votes
by (162k points)
We've now got a RollingFileAppender. Email us to ask for a DLL to try it out (tell us which product you want btw). You should be able to subclass RollingFileAppender instead of FileAppender in exactly the same way as above.

Categories

...