Changed logging path to subdirectory of current install lib
This commit is contained in:
@ -9,6 +9,8 @@ using System.IO;
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
using System.Reflection;
|
||||||
|
using System.Diagnostics;
|
||||||
|
|
||||||
namespace StockDal
|
namespace StockDal
|
||||||
{
|
{
|
||||||
@ -72,7 +74,14 @@ namespace StockDal
|
|||||||
private void SaveLogging()
|
private void SaveLogging()
|
||||||
{
|
{
|
||||||
var output = JsonConvert.SerializeObject(DumpObjects, Formatting.Indented);
|
var output = JsonConvert.SerializeObject(DumpObjects, Formatting.Indented);
|
||||||
File.WriteAllText($"D:\\TimCoDemos\\DemoLogs\\Log{DateTime.Now.ToShortDateString()}.txt",output);
|
Assembly assem = typeof(StockMarketRepository).Assembly;
|
||||||
|
var programPath = assem.Location.Substring(0, assem.Location.LastIndexOf("\\"));
|
||||||
|
var logPath = new DirectoryInfo(programPath + "\\Loggings");
|
||||||
|
if (!logPath.Exists)
|
||||||
|
{
|
||||||
|
logPath.Create();
|
||||||
|
}
|
||||||
|
File.WriteAllText($"{programPath}\\Loggings\\Log{DateTime.Now.ToShortDateString()}.txt", output);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void AddValueToListRow(int pos, string value)
|
private void AddValueToListRow(int pos, string value)
|
||||||
|
|||||||
Reference in New Issue
Block a user