Our Products:   CompleteFTP  edtFTPnet/Free  edtFTPnet/PRO  edtFTPj/Free  edtFTPj/PRO
0 votes
8.6k views
in .NET FTP by
Hi,

I've modified the EnterpriseDT.Util.Debug.Level.GetLevel() to "public" to allow me to set a level without using the "edtftp.log.level" application setting. That is because the process I want to trace/debug is called indirectly so I cannot use that setting.

I wander if there's a better (right) way to do this, without touching the debugger code.

Also I had to comment the Logger warning (LEVEL_PARAM + "' not found or invalid - logging switched off") because isn't true in this scenario.

TIA!

7 Answers

0 votes
by (560 points)
Hmm, not bad - I may do the same thing.

But - what I would really like is the ability to specify where/how debug/tracing for edtFTPnet works.

My application is console-based, and reports on activities as it proceeds. If I turn on edtFTPnet logging, it mucks with my output.

Ideally, I would like to be able to set a config setting, and have FTP output logged to a file.

Ah, but what about multithreading (as in my app) - multiple files, one per thread? I dunno, any ideas?
0 votes
by (162k points)
Why aren't you using the Logger.CurrentLevel property?

Hi,

I've modified the EnterpriseDT.Util.Debug.Level.GetLevel() to "public" to allow me to set a level without using the "edtftp.log.level" application setting. That is because the process I want to trace/debug is called indirectly so I cannot use that setting.

I wander if there's a better (right) way to do this, without touching the debugger code.

Also I had to comment the Logger warning (LEVEL_PARAM + "' not found or invalid - logging switched off") because isn't true in this scenario.

TIA!
0 votes
by (162k points)
You need to use the FileAppender that is supplied. Have a look at the nunit tests that are bundled with the distro - they log to a file.

Hmm, not bad - I may do the same thing.

But - what I would really like is the ability to specify where/how debug/tracing for edtFTPnet works.

My application is console-based, and reports on activities as it proceeds. If I turn on edtFTPnet logging, it mucks with my output.

Ideally, I would like to be able to set a config setting, and have FTP output logged to a file.

Ah, but what about multithreading (as in my app) - multiple files, one per thread? I dunno, any ideas?
0 votes
by (560 points)
You need to use the FileAppender that is supplied. Have a look at the nunit tests that are bundled with the distro - they log to a file.


I did - but when I tried it in my multithreaded client, it crashed horribly. Probably because I was trying to write to the same file.

Hmm, if I change the file naming logic to add the current thread id, this would work - but be ugly to manage (I may be transferring several thousand files, groups on different threads depending on their destinations).

Perhaps, instead I will create a different appender that is thread-safe.
0 votes
by
Why aren't you using the Logger.CurrentLevel property?


That is exactly what I do:
Logger.CurrentLevel = Level.GetLevel(m_logLevel) ;

That was because I needed public access to GetLevel(); to transform the string "m_logLevel" to a Level

because this cast doesn't works:
Logger.CurrentLevel = (Level) m_logLevel ;

What should I do?
Thanks!
0 votes
by (162k points)
Oh I see - you want to read it from a config somewhere & then get a Level.

Just change it to public - we'll make it public in the next release.


Why aren't you using the Logger.CurrentLevel property?


That is exactly what I do:
Logger.CurrentLevel = Level.GetLevel(m_logLevel) ;

That was because I needed public access to GetLevel(); to transform the string "m_logLevel" to a Level

because this cast doesn't works:
Logger.CurrentLevel = (Level) m_logLevel ;

What should I do?
Thanks!
0 votes
by (162k points)
Level.GetLevel() is public in the latest release, 1.1.5

Categories

...