Ejemplo n.º 1
0
 public static void ConfigureSeriLog()
 {
     Log.Logger = new LoggerConfiguration()
                  .MinimumLevel.Debug()
                  .Enrich.With(new ThreadIdEnricher())
                  .WriteTo.RollingFile(ArkadeConstants.GetArkadeLogDirectory() + "\\arkade-{Date}.log",
                                       outputTemplate: $"{Resources.UI.SerilogFormatConfig}")
                  .WriteTo.ColoredConsole(outputTemplate: $"{Resources.UI.SerilogFormatConfig}")
                  .CreateLogger();
 }
Ejemplo n.º 2
0
        public string WriteToFile()
        {
            string timeStamp = DateTime.Now.ToString("ddMMyyHHmmss");

            string fileName = Path.Combine(
                ArkadeConstants.GetArkadeLogDirectory().FullName,
                string.Format(Resources.UI.DetailedErrorMessageFileName, timeStamp)
                );

            try
            {
                File.WriteAllText(fileName, _errorMessage);

                return(fileName);
            }
            catch (Exception)
            {
                ShowMessageBox();

                return(string.Empty);
            }
        }