File tree Expand file tree Collapse file tree 1 file changed +25
-0
lines changed
test/Serilog.Sinks.AzureTableStorageWithProperties.Tests Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -74,6 +74,31 @@ public void WhenALoggerWritesToTheSinkItIsRetrievableFromTheTableWithProperties(
7474 Assert . Equal ( " " , result . Properties [ "Space" ] . PropertyAsObject ) ;
7575 }
7676
77+ [ Fact ]
78+ public void WhenALoggerWritesToTheSinkWithANewlineInTheTemplateItIsRetrievable ( )
79+ {
80+ // Prompted from https://github.com/serilog/serilog-sinks-azuretablestorage/issues/10
81+ var storageAccount = CloudStorageAccount . DevelopmentStorageAccount ;
82+ var tableClient = storageAccount . CreateCloudTableClient ( ) ;
83+ var table = tableClient . GetTableReference ( "LogEventEntity" ) ;
84+
85+ table . DeleteIfExists ( ) ;
86+
87+ var logger = new LoggerConfiguration ( )
88+ . WriteTo . AzureTableStorageWithProperties ( storageAccount )
89+ . CreateLogger ( ) ;
90+
91+ var exception = new ArgumentException ( "Some exception" ) ;
92+
93+ const string messageTemplate = "Line 1\n Line2" ;
94+
95+ logger . Information ( exception , messageTemplate ) ;
96+
97+ var result = table . ExecuteQuery ( new TableQuery ( ) . Take ( 1 ) ) . FirstOrDefault ( ) ;
98+
99+ Assert . NotNull ( result ) ;
100+ }
101+
77102 [ Fact ]
78103 public void WhenALoggerWritesToTheSinkItStoresTheCorrectTypesForScalar ( )
79104 {
You can’t perform that action at this time.
0 commit comments