@@ -34,9 +34,11 @@ public static LogEvent FromProperties(IDictionary<string, object?> properties, s
3434 var messageTemplate = GetMessageTemplate ( properties ) ;
3535 var props = GetLogEventProperties ( properties , remainder , level ) ;
3636
37+ var fallbackMappedLevel = level != null ? LevelMapping . ToSerilogLevel ( level ) : LogEventLevel . Information ;
38+
3739 return new LogEvent (
3840 timestamp ,
39- LogEventLevel . Information ,
41+ fallbackMappedLevel ,
4042 exception ,
4143 messageTemplate ,
4244 props ) ;
@@ -56,12 +58,13 @@ static MessageTemplate GetMessageTemplate(IDictionary<string, object?> propertie
5658 return NoMessage ;
5759 }
5860
59- static string GetLevel ( IDictionary < string , object ? > properties )
61+ static string ? GetLevel ( IDictionary < string , object ? > properties )
6062 {
6163 if ( properties . TryGetValue ( ReifiedProperties . Level , out var l ) &&
6264 l is TextSpan ts )
6365 return ts . ToStringValue ( ) ;
64- return LogEventLevel . Information . ToString ( ) ;
66+
67+ return null ;
6568 }
6669
6770 static Exception ? TryGetException ( IDictionary < string , object ? > properties )
@@ -72,7 +75,7 @@ static string GetLevel(IDictionary<string, object?> properties)
7275 return null ;
7376 }
7477
75- static IEnumerable < LogEventProperty > GetLogEventProperties ( IDictionary < string , object ? > properties , string ? remainder , string level )
78+ static IEnumerable < LogEventProperty > GetLogEventProperties ( IDictionary < string , object ? > properties , string ? remainder , string ? level )
7679 {
7780 var payload = properties
7881 . Where ( p => ! ReifiedProperties . IsReifiedProperty ( p . Key ) )
0 commit comments