Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- internal static void LocalLog(Exception trace)
- {
- try
- {
- string InfoText = string.Empty;
- if (trace != null)
- {
- InfoText += Environment.NewLine + Newtonsoft.Json.JsonConvert.SerializeObject(trace, Newtonsoft.Json.Formatting.Indented)
- + Environment.NewLine;
- }
- var path = Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData) + "\\";
- if (!Directory.Exists(path))
- Directory.CreateDirectory(path);
- var logfile = path + "\\" + DateTime.Now.Year + "." + DateTime.Now.Month + "." + DateTime.Now.Day + " WSRecaudoTercero.log";
- File.AppendAllText(logfile, DateTime.Now + " - " + Environment.NewLine + InfoText + Environment.NewLine + Environment.NewLine);
- }
- catch
- {
- //asdf
- }
- }
Add Comment
Please, Sign In to add comment