Bump Serilog and Serilog.Sinks.TextWriter #11
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Rebasing might not happen immediately, so don't worry if this takes some time.
Note: if you make any changes to this PR yourself, they will take precedence over the rebase.
Updated Serilog from 2.0.0 to 4.0.0.
Release notes
Sourced from Serilog's releases.
4.0.0
What's new in Serilog 4.0.0?
Simple, robust, built-in batching support
Sinks that need batching functionality can now be easily written, without any additional package dependencies, by implementing
IBatchedLogEventSink:Batched sinks can be added using
WriteTo.Sink(IBatchedLogEventSink, ...)- they're given first-class consideration just like regular un-batched sinks.The built-in batching implementation is based on
System.Threading.Channelsand draws on the originalSerilog.Sinks.PeriodicBatchingpackage (now in maintenance-mode), to provide a full-featured, efficient, async-native batching implementation.Experimental dotted name capturing
By setting an experimental
AppContextswitch, message templates can be used to capture dotted names, which are required when using some logging schemas.While currently experimental and unsupported, this flag is intended to help the ecosystem evaluate and prepare for dotted name support in a future Serilog release.
Changes
UtcTimestampas a built-in token in output templates (@MatthewHays)ReusableStringWriter(@nblumhardt)LogEvent.UnstableAssembleFromParts()(@nblumhardt)IBatchedLogEventSinkandWriteTo.Sink(IBatchedLogEventSink)(@nblumhardt)LoggerSinkConfiguration.CreateSink()and redesign.Wrap()(@nblumhardt, @bartelink)MessageTemplateParserperformance, switch to allow.in captured property names (@nblumhardt)}in message template format specifiers (@Insomniak47)... (truncated)
3.1.1
ReusableStringWriterwith large renderings (@nblumhardt)This is a bugfix for release 3.1.0.
3.1.0
CHANGES.md(@sungam3r)README.mdupdates (@nblumhardt)GetTypeInfo()calls (@SimonCropp)Logger.Write()(@epeshk)Activity.Current.TraceIdandSpanIdautomatically inLogger.Write()(@nblumhardt)README.mdupdates (@bartelink)Built-in trace and span id support
This release adds two new first-class properties to
LogEvent:TraceIdandSpanId. These are set automatically inLogger.Write()to the corresponding property values fromSystem.Diagnostics.Activity.Current.The major benefit of this change is that sinks, once updated, can reliably propagate trace and span ids through to back-ends that support them (in much the same way that first-class timestamps, messages, levels, and exceptions are used today).
The sinks maintained under
serilog/serilog, along with formatting helpers such as Serilog.Formatting.Compact and Serilog.Expressions, are already compatible with this change or have pending releases that add compatibility.Dropped .NET Core 2.1 and 3.0 support
On .NET Core 2.1 and 3.0, projects targeting Serilog 3.1+ will fail to build, with:
Affected consumers should continue to use Serilog 3.0 or earlier. See serilog/serilog#1983 for a discussion of this issue.
Technical breaking changes
Trace and span id placeholders
Trace and span id collection includes support for
{TraceId}and{SpanId}placeholders in output templates (commonly used when formatting text log files). Where previously these names resolved to user-defined properties, they now resolve to the built-inLogEvent.TraceIdandLogEvent.SpanIdvalues, respectively.Impact is expected to be low/zero, because the trace and span id values in any user-added properties are almost certainly identical to the built-in ones.
nintandnuint(IntPtrandUIntPtr) handlingThese integer types were previously logged as structures. They're now correctly logged as scalars.
3.0.1
JsonFormatteroutput forrenderMessage = true(@nblumhardt)3.0.0
What's new in 3.0.0?
Target framework changes - Serilog no longer targets
netstandard1.xor .NET Framework versions earlier than .NET 4.6.2. Users on affected frameworks should continue to target Serilog 2.12.x.Removed obsolete APIs - Many deprecated/obsolete types and functions have been removed. Notably,
JsonFormattercan no longer be subclassed (either port toJsonValueFormatter, use Serilog.Expressions, or copy the originalJsonFormattercode into your project).Added APIs -
LevelAlias.Offis now provided as an equivalent to Microsoft.Extensions.Logging'sLogLevel.Off;Destructure.AsDictionary<T>()can now be used to mark dictionary types.Fewer allocations on many hot paths - A lot of work has gone into avoiding heap allocations wherever possible.
Changes
IEnumeratorallocation (#1769) by @igor84 in Avoided IEnumerator allocation (#1769) serilog/serilog#1770ScalarValue.Nullby @sungam3r in Introduce ScalarValue.Null serilog/serilog#1774Tokens->TokenArrayby @sungam3r in Tokens -> TokenArray serilog/serilog#1778netstandard1.3andnetstandard1.0support by @SimonCropp in Drop netstandard1.3 and netstandard1.0 support serilog/serilog#1807JsonFormatter.Escapeby @SimonCropp in Remove JsonFormatter.Escape serilog/serilog#1804WriteLine(char)by @SimonCropp in use WriteLine char serilog/serilog#1803JsonFormatterby subclassing by @SimonCropp in Remove Extension of JsonFormatter by subclassing serilog/serilog#1801LoggerSinkConfigurationby @SimonCropp in Remove redundant overrides from LoggerSinkConfiguration serilog/serilog#1800StringWriter.ToString()calls by @sungam3r in Avoid StringWriter.ToString() calls serilog/serilog#1782RawFormattertype by @nblumhardt in Remove the obsoleteRawFormattertype serilog/serilog#1808OutputProperties.GetOutputProperties()by @SimonCropp in Remove OutputProperties.GetOutputProperties serilog/serilog#1805Where()calls inFindConfigurationMethods()by @SimonCropp in Remove duplicate Wheres in FindConfigurationMethods serilog/serilog#1812net45support by @SimonCropp in Remove net45 support serilog/serilog#1811GetTypeInfo()inLoadConfigurationAssembliesby @SimonCropp in Remove redundant GetTypeInfo in LoadConfigurationAssemblies serilog/serilog#1817GetTypeInfo()fromFindConfigurationMethods(()by @SimonCropp in Remove typeinfo from FindConfigurationMethods serilog/serilog#1815GetTypeInfo()inEnumScalarConversionPolicyby @SimonCropp in Remove redundant GetTypeInfo in EnumScalarConversionPolicy serilog/serilog#1816PropertyTokenconstructor by @SimonCropp in Remove obsolete PropertyToken constructor serilog/serilog#1819switchexpressions by @SimonCropp in thoughts on switch expressions? serilog/serilog#1818TextWriter.Write()by @sungam3r in Do not allocate strings for TextWriter.Write serilog/serilog#1775SettingValueConversionsby @SimonCropp in Simplify reflection in SettingValueConversions serilog/serilog#1814GetPropertiesRecursive()performance by @SimonCropp in Improve GetPropertiesRecursive performance serilog/serilog#1813Convert.ToHexString()inByteArrayScalarConversionPolicy()by @sungam3r in Use Convert.ToHexString in ByteArrayScalarConversionPolicy serilog/serilog#1776FEATURE_ASYNCLOCALby @SimonCropp in remove FEATURE_ASYNCLOCAL serilog/serilog#1822FEATURE_HASHTABLEby @SimonCropp in remove FEATURE_HASHTABLE serilog/serilog#1823IsEnumfor enum check inEnumScalarConversionPolicyby @SimonCropp in use is Enum for enum check in EnumScalarConversionPolicy serilog/serilog#1825Hashtableuse inMessageTemplateCacheby @SimonCropp in comments on Hashtable in MessageTemplateCache serilog/serilog#1828GetTypeInfo()fromPropertyValueConverterby @SimonCropp in Remove GetTypeInfo from PropertyValueConverter serilog/serilog#1824GetType()inPropertyValueConverterby @SimonCropp in avoid repeated GetType in PropertyValueConverter serilog/serilog#1832TryAdd()and items constructor by @SimonCropp in Leverage dictionary TryAdd and items constructor serilog/serilog#1830PropertyValueConverterby @SimonCropp in Use array instead of list when we know the size in PropertyValueConverter serilog/serilog#1831net46target tonet461by @SimonCropp in Move net46 to net461 serilog/serilog#1827... (truncated)
2.12.0
Highlights of 2.12.0
Improved and expanded
<Nullable>enable</Nullable>supportA huge number of commits have gone into completing and refining non-null reference type annotations, which now cover the entire public Serilog API. The Serilog project itself now builds with non-null reference type checking globally enabled 🎉
IAsyncDisposablesupportSinks that need to flush changes using asynchronous APIs can now implement
IAsyncDisposableand prevent the possibility of deadlocking while waiting for tasks to complete.To drive this,
Loggercan now be disposed viausing async:and the
Logclass providesLog.CloseAndFlushAsync():DateOnlyandTimeOnlysupportThe
DateOnlyandTimeOnlytypes introduced in .NET 6 are now correctly handled as scalar values when capturing.Merged PRs
DateOnlyandTimeOnlysupport (@SimonCropp)IAsyncDisposablesupport forLoggerand sinks (@nblumhardt)!operator fromnullin conditions (@sungam3r)ValueTuple(@SimonCropp)2.11.0
staticto avoid scope capture (@SimonCropp)string[]to key-value settings (@stochmal)net5.0target (@nblumhardt)MessageTemplateFormatMethod(@JinsPeter)Memory<T>/ReadOnlyMemory<T>and non-reflection-compatible properties e.g. of typeSpan<T>(@skomis-mm)ILoggerdocumentation (@erichiller)2.10.0
ToString()throws an exception (@rafaelsc)netstandard2.1support and default implementations forILoggermethods (@skomis-mm)MinimumLevel.Override()runtime optimizations (@skomis-mm)LoggerSinkConfiguration.Wrap()ToString()on a logged object returnsnull, serialize as""(@rafaelsc, @nblumhardt)2.9.0
snupkgsymbol packages (@teo-tsirpanis)MessageTemplateTextFormatter(@bender2k14)netstandard2.0target (@WeihanLi)INFLUENCES.md(@nblumhardt)+(@martinh2011)2.8.0
Destructure.AsScalar(type)in key-value settings (@tsimbalar)Destructure.Xxx()in key-value settings (@tsimbalar)Destructure.With(policy)in key-value settings (@tsimbalar)Logger.InstancewithLogger.None(@ie-zero)*.With(...)andAuditTo.Sink(sink)/WriteTo.Sink(sink)in key-value settings (@tsimbalar)repositoryUrlin the NuGet package (@MaximRouiller)netcoreapp2.0(@merbla)IFormatProvidersupport (@tsimbalar)ForContext()to destructure some generated proxy types (@balayoglu)netstandard2.0target to shrink dependency graph on compatible platforms (@nblumhardt)2.7.1
Version 2.7.0 was skipped due to a versioning mistake.
LoggerSinkConfiguration.Wrap()acceptingLoggingLevelSwitchhttps://project and icon URLs{Properties:j}work consistently with the console sinkLogger.NoneLogContextbuild.shexit codebyte[]smaller than 1 KBLoggerSinkConfiguration.Wrap()affectingWriteTo.Async()LoggerConfigurationto be garbage collected after logger is created2.6.0
LogContextremoting issue on .NET Framework 4.5LogContext.Suspend()andLogContext.Reset()to pass or drop context from child tasksLoggingLevelSwitchin key-value/<appSettings>settingsMinimumLevel.Override()is used in a sub-loggerILogger.ForContext()/Log.ForContext()<appSettings>settings (last-in wins)<appSettings>valuesPlus build/documentation items #988, #994, #996, #1019, #842, #1042, #1050, #1055, #1063.
2.5.0
LoggerSinkConfiguration.Wrap(){Properties}in output templatesLogContext.Clone()andLogContext.Push(ILogEventEnricher)ValueTuple<>values{Message:l}(unquoted string) and{Message:j}(JSON structure) support in output templatesPlus multiple build/test/configuration improvements.
2.4.0
NaNand infinity valuesLogstatic methods to matchILoggermethodsAssemblyInformationalVersionfilterdirectivesPlus build and test coverage work in #821, #824, #896, etc.
2.3.0
RemotingExceptionviaLogContextICustomFormattersupportaudit-toin key-value settings2.2.1
2.2.0
2.1.0
#782 - provide Destructure.ByTransformingWhere()
#779 - capture additional parameters even when template is malformed
#798 - fix overload selection in KeyValueSettings
#815 - allow level to be lowered by overrides, in addition to being raised
Commits viewable in compare view.
Updated Serilog.Sinks.TextWriter from 2.0.0 to 3.0.0.
Release notes
Sourced from Serilog.Sinks.TextWriter's releases.
3.0.0
README.mdheader (@danielchalmers)Breaking changes
TFMs prior to
netstandard2.0are no longer supported; use the 2.x series of packages on these platforms.2.1.0
ITextFormattersupport (@krajek)Commits viewable in compare view.
Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting
@dependabot rebase.Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR:
@dependabot rebasewill rebase this PR@dependabot recreatewill recreate this PR, overwriting any edits that have been made to it@dependabot mergewill merge this PR after your CI passes on it@dependabot squash and mergewill squash and merge this PR after your CI passes on it@dependabot cancel mergewill cancel a previously requested merge and block automerging@dependabot reopenwill reopen this PR if it is closed@dependabot closewill close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually@dependabot show <dependency name> ignore conditionswill show all of the ignore conditions of the specified dependency@dependabot ignore this major versionwill close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)@dependabot ignore this minor versionwill close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)@dependabot ignore this dependencywill close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)