Skip to content

Commit

Permalink
remove obsolete, updated docs
Browse files Browse the repository at this point in the history
  • Loading branch information
304NotModified committed May 25, 2019
1 parent 7d0301b commit 7489261
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions src/NLog/Logger.cs
Expand Up @@ -86,8 +86,8 @@ protected internal Logger()
/// Collection of context properties for the Logger. The logger will append it for all log events
/// </summary>
/// <remarks>
/// It is recommended to only use <see cref="WithProperty(string, object)"/> for modifying context properties.
/// Because direct changes might give unexpected side-effects as multiple locations can share the same logger-object.
/// It is recommended to use <see cref="WithProperty(string, object)"/> for modifying context properties
/// when sharing the same loggers accross multiple classes.
/// </remarks>
public IDictionary<string, object> Properties => _contextProperties ?? System.Threading.Interlocked.CompareExchange(ref _contextProperties, CreateContextPropertiesDictionary(null), null) ?? _contextProperties;

Expand Down Expand Up @@ -126,14 +126,21 @@ public Logger WithProperty(string propertyKey, object propertyValue)
}

/// <summary>
/// Updates the specified context property for the current logger. The logger will append it for all log events
/// Updates the specified context property for the current logger. The logger will append it for all log events.
///
/// It could be rendered with ${event-properties:YOURNAME}
///
/// With <see cref="Properties"/> property, all properties could be changed.
/// </summary>
/// <remarks>
/// Will affect all locations/contexts that makes use of the same named logger object.
/// </remarks>
/// <param name="propertyKey">Property Name</param>
/// <param name="propertyValue">Property Value</param>
[Obsolete("Instead use the Properties-property to access or modify the active collection")]
/// <remarks>
/// It is recommended to use <see cref="WithProperty(string, object)"/> for modifying context properties
/// when sharing the same loggers accross multiple classes.
/// </remarks>
public void SetProperty(string propertyKey, object propertyValue)
{
if (string.IsNullOrEmpty(propertyKey))
Expand Down

0 comments on commit 7489261

Please sign in to comment.