Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose logger properties on Logger #3424

Closed
wants to merge 3 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/NLog/Logger.cs
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,14 @@ protected internal Logger()
/// </summary>
public LogFactory Factory { get; private set; }

#if !NET3_5 && !NET4_0 && !SILVERLIGHT && !WINDOWS_PHONE
304NotModified marked this conversation as resolved.
Show resolved Hide resolved

/// <summary>
/// Properties added with <see cref="WithProperty"/> or <see cref="SetProperty"/>
/// </summary>
public IDictionary<string, object> Properties => _contextProperties ?? new Dictionary<string, object>();
public IReadOnlyDictionary<string, object> Properties => CreateContextPropertiesDictionary(_contextProperties); //clone for immutable

#endif

/// <summary>
/// Gets a value indicating whether logging is enabled for the specified level.
Expand Down