moved default event log to its own log

This commit is contained in:
Justin Gerhardt
2016-07-05 04:35:10 -04:00
parent aa0eb065b6
commit e21eebd57e
3 changed files with 12 additions and 0 deletions

View File

@@ -24,6 +24,7 @@
using System.ComponentModel;
using System.Configuration.Install;
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using System.ServiceProcess;
@@ -45,8 +46,15 @@ namespace ArchiSteamFarm {
// System account, requires admin privilege to install
serviceProcessInstaller.Account = ServiceAccount.LocalSystem;
EventLogInstaller logInstaller = new EventLogInstaller
{
Log = SharedInfo.EventLog,
Source = SharedInfo.EventLogSource
};
Installers.Add(serviceInstaller);
Installers.Add(serviceProcessInstaller);
Installers.Add(logInstaller);
}
}
}

View File

@@ -83,6 +83,8 @@ namespace ArchiSteamFarm {
if (Program.IsRunningAsService) {
EventLogTarget eventLogTarget = new EventLogTarget("EventLog") {
Layout = EventLogLayout,
Log = SharedInfo.EventLog,
Source = SharedInfo.EventLogSource
};
LogManager.Configuration.AddTarget(eventLogTarget);

View File

@@ -30,5 +30,7 @@ namespace ArchiSteamFarm {
internal const string GithubRepo = "JustArchi/ArchiSteamFarm";
internal const string ServiceName = "ArchiSteamFarm";
internal const string ServiceDescription = "ASF is an application that allows you to farm steam cards using multiple steam accounts simultaneously.";
internal const string EventLog = "ArchiSteamFarm";
internal const string EventLogSource = "ArchiSteamFarmLogger";
}
}