Hello, i'm using edtFTPnet free 2.2.1 version.
I would like using its logging system, which seems great, but i'm having trouble with writing log files for more than one ftp connection.
Seems that having more than one class using the Logger, the log entries are "mixed up" among log files.
Example, if i run this code:
FTPConnection ftpconn1 = new FTPConnection();
Logger logger1 = Logger.GetLogger(typeof(FTPConnection));
FTPConnection.LogLevel = LogLevel.Information;
FTPConnection.LogFile = "log1.txt";
logger1.Info("connection 1 info");
logger1.Error("connection 1 error");
FTPConnection ftpconn2 = new FTPConnection();
Logger logger2 = Logger.GetLogger(typeof(FTPConnection));
FTPConnection.LogLevel = LogLevel.Information;
FTPConnection.LogFile = "log2.txt";
logger2.Info("connection 2 info");
logger2.Error("connection 2 error");
Logger.Shutdown();
everything is fine, i got two message per log file.
But when this code is run
FTPConnection ftpconn1 = new FTPConnection();
Logger logger1 = Logger.GetLogger(typeof(FTPConnection));
FTPConnection.LogLevel = LogLevel.Information;
FTPConnection.LogFile = "log1.txt";
FTPConnection ftpconn2 = new FTPConnection();
Logger logger2 = Logger.GetLogger(typeof(FTPConnection));
FTPConnection.LogLevel = LogLevel.Information;
FTPConnection.LogFile = "log2.txt";
logger1.Info("connection 1 info");
logger2.Info("connection 2 info");
logger1.Error("connection 1 error");
logger2.Error("connection 2 error");
Logger.Shutdown();
i got all log entries mixed up... i don't get each connection's message logged into the right log file.
Why such behaviour?
Any ideas?
Thank you,
Marco