예제 #1
0
        public static void Log(params Exception[] exception)
        {
            var ri = new ExceptionReportInfo();

            ri.SetExceptions(exception);
            var rg = new ExceptionReportGenerator(ri);

            Log(rg.CreateExceptionReport());
        }
예제 #2
0
        public ExceptionReportGenerator(ExceptionReportInfo reportInfo)
        {
            if (reportInfo == null)
            {
                throw new ExceptionReportGeneratorException("reportInfo cannot be null");
            }

            _reportInfo = reportInfo;

            _reportInfo.ExceptionDate = DateTime.UtcNow;
            _reportInfo.UserName      = Environment.UserName;
            _reportInfo.MachineName   = Environment.MachineName;

            if (_reportInfo.AppAssembly == null)
            {
                _reportInfo.AppAssembly = Assembly.GetEntryAssembly() ?? Assembly.GetCallingAssembly();
            }
        }
예제 #3
0
 public ExceptionReportBuilder(ExceptionReportInfo reportInfo, IEnumerable <SysInfoResult> sysInfoResults)
     : this(reportInfo)
 {
     _sysInfoResults = sysInfoResults;
 }
예제 #4
0
 public ExceptionReportBuilder(ExceptionReportInfo reportInfo)
 {
     _reportInfo = reportInfo;
 }