Use shared LIAM logger for NTFS engine fallback
This commit is contained in:
@@ -26,8 +26,6 @@ namespace C4IT_IAM_SET
|
||||
{
|
||||
public class DataArea_FileSystem
|
||||
{
|
||||
public const string constApplicationDataPath = "%ProgramData%\\Consulting4IT GmbH\\LIAM";
|
||||
|
||||
public string domainName;
|
||||
public string effectiveDomainController;
|
||||
public string username;
|
||||
@@ -99,10 +97,7 @@ namespace C4IT_IAM_SET
|
||||
if (Interlocked.Exchange(ref engineFileLoggerInitialized, 1) != 0)
|
||||
return;
|
||||
|
||||
var logDirectory = Environment.ExpandEnvironmentVariables(constApplicationDataPath);
|
||||
Helper.CreatePathWithWriteAccess(logDirectory);
|
||||
var LogPath = Path.Combine(logDirectory, "Logs");
|
||||
cLogManagerFile.CreateInstance(Path.Combine(LogPath, "LIAM.log"));
|
||||
cLogManagerFile.CreateInstance(LocalMachine: true, A: Assembly.GetExecutingAssembly());
|
||||
}
|
||||
|
||||
private string GetAdServer()
|
||||
|
||||
@@ -14,6 +14,7 @@ using System.Security.AccessControl;
|
||||
using System.Security.Principal;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using System.Xml;
|
||||
using System.Xml.Serialization;
|
||||
@@ -32,8 +33,6 @@ namespace C4IT_IAM_GET
|
||||
}
|
||||
public class DataArea_FileSystem
|
||||
{
|
||||
public const string constApplicationDataPath = "%ProgramData%\\Consulting4IT GmbH\\LIAM";
|
||||
|
||||
public string domainName;
|
||||
public string DomainIPAddress;
|
||||
public string username;
|
||||
@@ -74,6 +73,7 @@ namespace C4IT_IAM_GET
|
||||
|
||||
public string SecGroupXML;
|
||||
public string DataAreasXML;
|
||||
private static int engineFileLoggerInitialized;
|
||||
|
||||
public SecureString Password { get => password; set => password = value; }
|
||||
public string StartDir { get => startDir; set => startDir = value; }
|
||||
@@ -130,15 +130,26 @@ namespace C4IT_IAM_GET
|
||||
|
||||
public DataArea_FileSystem()
|
||||
{
|
||||
var logDirectory = Environment.ExpandEnvironmentVariables(constApplicationDataPath);
|
||||
Helper.CreatePathWithWriteAccess(logDirectory);
|
||||
var LogPath = Path.Combine(logDirectory, "Logs");
|
||||
cLogManagerFile.CreateInstance(Path.Combine(LogPath, "LIAM.log"));
|
||||
EnsureEngineFileLoggerInitialized();
|
||||
if (DefaultLogger != null)
|
||||
{
|
||||
DefaultLogger.LogEntry(LogLevels.Info, "=================================================");
|
||||
DefaultLogger.LogEntry(LogLevels.Info, $"LIAM engine v{Assembly.GetExecutingAssembly().GetName().Version} started");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private static void EnsureEngineFileLoggerInitialized()
|
||||
{
|
||||
if (DefaultLogger != null)
|
||||
return;
|
||||
|
||||
if (Interlocked.Exchange(ref engineFileLoggerInitialized, 1) != 0)
|
||||
return;
|
||||
|
||||
cLogManagerFile.CreateInstance(LocalMachine: true, A: Assembly.GetExecutingAssembly());
|
||||
}
|
||||
|
||||
private void FillMatchingGroups()
|
||||
{
|
||||
LogMethodBegin(MethodBase.GetCurrentMethod());
|
||||
|
||||
Reference in New Issue
Block a user