0 votes
by (2.0k points)

Hi.

I would like to do detailed tracing while using FTP/SFTP.
When I look at the log of FTP/SFTP's LogWriter, there is an Instance ID, and I want to record the same Intance ID in my log or LogWriter.Write.
Can I get the InstanceID of the FTP?

2020-09-30 14:01:18.965 DEBUG Ftp(2)[39] Info: Data transfer started.

LogWriter.Write(Rebex.LogLevel.Debug, typeof(Ftp), ???, "MYLOG", format);

Thank you.
Bookyung Oh

Applies to: Rebex FTP/SSL, Rebex SFTP

1 Answer

0 votes
by (148k points)

Hi,

There is InstanceId property, but it's currently protected. To work around this, consider inheriting a custom class from Ftp and adding a property that makes it accessible, and use the class in your code instead of Ftp:

public class MyFtp : Ftp
{
    public int Id
    {
        get { return InstanceId; }
    }
}
by (2.0k points)
edited by
In Rebex 2020R3, Ftp class does not have InstanceId.

In NetworkSession class,

protected internal int myxbq { get; } <-- is InstanceId?

Code Obfuscation?
by (148k points)
Oops, this seems to have slipped into R3 by mistake. We'll fix it as soon as possible and publish a new release. Sorry for the inconvenience!
by (148k points)
We have just released 2020 R4 which fixes this issue.
...