public Initialize ( string resourceManagerId ) : void | ||
resourceManagerId | string | |
return | void |
public void Initialize(string resourceManagerId)
{
this.resourceManagerId = resourceManagerId;
// Test if the location configured is valid.
if(!Directory.Exists(Location))
{
if(AutoCreateLocation)
{
try
{
Directory.CreateDirectory(Location);
}
catch(Exception ex)
{
Tracer.Error("Failed to create log directory: " + ex.Message);
throw NMSExceptionSupport.Create(ex);
}
}
else
{
throw new NMSException("Configured Recovery Log Location does not exist: " + location);
}
}
}
public void TestInitWithNoLocationSet() { RecoveryFileLogger logger = new RecoveryFileLogger(); logger.Initialize(rmId.ToString()); Assert.AreEqual(Directory.GetCurrentDirectory(), logger.Location); }