This repository was archived by the owner on Nov 10, 2017. It is now read-only.
File tree Expand file tree Collapse file tree
src/Sitecore.Azure.Diagnostics Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11using log4net . Appender ;
22using log4net . spi ;
3+ using Microsoft . WindowsAzure . Storage ;
34using Microsoft . WindowsAzure . Storage . Blob ;
45using Sitecore . Azure . Diagnostics . Storage ;
56using System ;
@@ -100,8 +101,14 @@ protected override void Append(LoggingEvent loggingEvent)
100101 Sitecore . Diagnostics . Assert . ArgumentNotNull ( loggingEvent , "loggingEvent" ) ;
101102
102103 var blob = this . Blob as CloudAppendBlob ;
103- string message = this . RenderLoggingEvent ( loggingEvent ) ;
104104
105+ if ( ! blob . Exists ( ) )
106+ {
107+ // Create an empty append blob or throw an exception if the blob exists.
108+ blob . CreateOrReplace ( AccessCondition . GenerateIfNotExistsCondition ( ) ) ;
109+ }
110+
111+ string message = this . RenderLoggingEvent ( loggingEvent ) ;
105112 blob . AppendText ( message ) ;
106113 }
107114
Original file line number Diff line number Diff line change @@ -258,11 +258,11 @@ public virtual ICloudBlob CreateBlob(string blobName)
258258 this . CloudBlobContainer . GetAppendBlobReference ( blobName ) :
259259 this . GetContainer ( this . ContainerName ) . GetAppendBlobReference ( blobName ) ;
260260
261- if ( ! blob . Exists ( ) )
262- {
263- // Create an empty append blob or throw an exception if the blob exists.
264- blob . CreateOrReplace ( AccessCondition . GenerateIfNotExistsCondition ( ) ) ;
265- }
261+ // if (!blob.Exists())
262+ // {
263+ // // Create an empty append blob or throw an exception if the blob exists.
264+ // blob.CreateOrReplace(AccessCondition.GenerateIfNotExistsCondition());
265+ // }
266266
267267 return blob ;
268268 }
You can’t perform that action at this time.
0 commit comments