views:

15

answers:

0

I'm using System.IO.Log.LogRecordSequence for logging and I'm running in to a problem when I'm archiving the log.

The log is created as such:

m_oSequence = new LogRecordSequence("log dir path\alex.log"),FileMode.OpenOrCreate, FileAccess.ReadWrite, FileShare.ReadWrite);
if (0 == m_oSequence.LogStore.Extents.Count)
{
 fnAddExtent();
 fnAddExtent();
 m_oSequence.LogStore.Archivable = true;
}
else
{
 m_nExtent = m_oSequence.LogStore.Extents.Count;
}

LogPolicy oPolicy = m_oSequence.LogStore.Policy;
oPolicy.AutoGrow = true;
oPolicy.PinnedTailThreshold = new PolicyUnit(2, PolicyUnitType.Extents);
oPolicy.GrowthRate = new PolicyUnit(2, PolicyUnitType.Extents);
oPolicy.MaximumExtentCount = 1 << 10; 
oPolicy.NewExtentPrefix = "alex-autogrow-extent";
oPolicy.NextExtentSuffix = 0;
oPolicy.Commit();
oPolicy.Refresh();
m_oSequence.RetryAppend = true;
m_oSequence.TailPinned += new EventHandler<TailPinnedEventArgs>(TailPinnedHandler);

When the log only contains the extents that were manually added, m_oSequence.LogStore.CreateLogArchiveSnapshot() works fine and I'm able to archive the log.

However, when calling m_oSequence.LogStore.CreateLogArchiveSnapshot() I get the following error message only when extents have been automatically added

Could not find file '%BLF%\alex-autogrow-extent00000000000000000002'

Reading the documentation, this error makes no sense to me. Does anybody have experience with this?