public SingleThreadLogger(ThreadLoggerType threadLoggerType)
        {
            if (!Directory.Exists(".//Logs"))
                Directory.CreateDirectory(".//Logs");

            _logPathName = ".//Logs//" + threadLoggerType + "_" + DateTime.Now.ToString("yyyy-MM-dd HH-mm-ss")+Guid.NewGuid()+".log";
        }
Example #2
0
        public SingleThreadLogger(ThreadLoggerType threadLoggerType)
        {
            String destPath = Program.GetDataPath("Logs");
            if (!Directory.Exists(destPath))
                Directory.CreateDirectory(destPath);

            _logPathName = Path.Combine(destPath, string.Format("{0}_{1:yyyy-MM-dd HH-mm-ss}{2}.log", threadLoggerType, DateTime.Now, Guid.NewGuid()));
        }
Example #3
0
        //private StreamWriter _streamWriter;

        public SingleThreadLogger(ThreadLoggerType threadLoggerType)
        {
            if (!Directory.Exists(".//Logs"))
            {
                Directory.CreateDirectory(".//Logs");
            }

            _logPathName = ".//Logs//" + threadLoggerType + "_" + DateTime.Now.ToString("yyyy-MM-dd HH-mm-ss") + Guid.NewGuid() + ".log";
        }
Example #4
0
        private Int32 maxFileSize = 10 * 1024 * 1024; // max. file size in MB

        public SingleThreadLogger(ThreadLoggerType threadLoggerType, String destPath = "", Boolean reuseLog = false)
        {
            if(String.IsNullOrEmpty(destPath))
                destPath = Program.GetDataPath("Logs");

            if (!Directory.Exists(destPath))
                Directory.CreateDirectory(destPath);

            if(reuseLog)
                _logPathName = Path.Combine(destPath, string.Format("{0}.log", threadLoggerType));
            else
                _logPathName = Path.Combine(destPath, string.Format("{0}_{1:yyyy-MM-dd HH-mm-ss}.log", threadLoggerType, DateTime.Now));
                
        }
Example #5
0
        private Int32 maxFileSize = 10 * 1024 * 1024; // max. file size in MB

        public SingleThreadLogger(ThreadLoggerType threadLoggerType, String destPath = "", Boolean reuseLog = false)
        {
            if (String.IsNullOrEmpty(destPath))
            {
                destPath = Program.GetDataPath("Logs");
            }

            if (!Directory.Exists(destPath))
            {
                Directory.CreateDirectory(destPath);
            }

            if (reuseLog)
            {
                _logPathName = Path.Combine(destPath, string.Format("{0}.log", threadLoggerType));
            }
            else
            {
                _logPathName = Path.Combine(destPath, string.Format("{0}_{1:yyyy-MM-dd HH-mm-ss}.log", threadLoggerType, DateTime.UtcNow));
            }
        }