APG.CodeHelper.ExceptionHandler.LogException.LogExceptionToFile C# (CSharp) Method

LogExceptionToFile() public static method

public static LogExceptionToFile ( Exception e ) : string
e System.Exception
return string
        public static string LogExceptionToFile(Exception e)
        {
            //���������� ������� ���� � �����
            DateTime et = DateTime.Now;
            //� ���������� LocalSetting\ApplicationData �������� ������������ �������� ����� ISGB
            string path = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) + "\\ISGB";
            Directory.CreateDirectory(path);
            //�������� �������� ����� (ISGB-����.�����.��� ���.������.�������-LOG.XML)
            string FileName = path + string.Format("\\{0}-{1}.{2}.{3} {4}.{5}.{6}-LOG.XML",
            AppDomain.CurrentDomain.FriendlyName, et.Day, et.Month, et.Year, et.Hour, et.Minute, et.Second);
            //�������� ������ ������
            FileStream fs = new FileStream(FileName, FileMode.CreateNew);
            Stream stream = ObjectStream.SerializeObjectToXML(e);
            byte[] buff = new byte[stream.Length];
            stream.Position = 0;
            stream.Read(buff, 0, (int)stream.Length);
            fs.Position = 0;
            fs.Write(buff, 0, (int)stream.Length);
            fs.Close();

            return FileName;
        }