.NET allows writing a custom logger

Advertisement

Julian304
Joined:
Posts:
10
Location:
Netherlands

.NET allows writing a custom logger

We like integrate the logging of WinSCP to NLog.

Currently the Logger is an internal class without an interface. Also the `_writter` can't be set, so there is now way to integrate a custom logger (like NLog).

I would be nice if that would be possible, e.g. by exposing a log interface (e.g. ILogger) and let others assign the ILogger.

PS: if accepted, are pull requests accepted on Github?

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
29,070
Location:
Prague, Czechia

Re: .NET allows writing a custom logger

Are you referring to a debug log or a session log?

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
29,070
Location:
Prague, Czechia

Thanks.
Though that's for a debug log. You primarily wanted a session log. But that would be way more difficult as session log is actually produced by an internal WinSCP.exe process, not by any .NET code.

Reply with quote

Julian304
Joined:
Posts:
10
Location:
Netherlands

The session log, it that the current XML log? Isn't that the SessionLogReader and that is also using the Logger?

Anyway, debug log for now is a good step.

Reply with quote

martin
Site Admin
martin avatar
Joined:
Posts:
29,070
Location:
Prague, Czechia

No session log is a plain text (Session.SessionLogPath). The XML log is an internal thing, not exposed in any way.

Reply with quote

Julian304
Joined:
Posts:
10
Location:
Netherlands

OK clear,

but the SessionLogReader is related to the Session log, isn't? So we could (in the future) add the logging integration there.

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
29,070
Location:
Prague, Czechia

Julian304 wrote:

but the SessionLogReader is related to the Session log, isn't?
No it's not. It's a reader for an XML log.
A session log is not machine-readable.

Reply with quote

Advertisement

You can post new topics in this forum