diff --git a/src/NLog/Common/LogEventInfoBuffer.cs b/src/NLog/Common/LogEventInfoBuffer.cs
index 014635d1e6..679e6c0812 100644
--- a/src/NLog/Common/LogEventInfoBuffer.cs
+++ b/src/NLog/Common/LogEventInfoBuffer.cs
@@ -34,11 +34,13 @@
namespace NLog.Common
{
using System;
+ using System.ComponentModel;
///
/// A cyclic buffer of object.
///
[Obsolete("Use AsyncRequestQueue instead. Marked obsolete on NLog 5.0")]
+ [EditorBrowsable(EditorBrowsableState.Never)]
public class LogEventInfoBuffer
{
private readonly object _lockObject = new object();
diff --git a/src/NLog/Config/INamedItemFactory.cs b/src/NLog/Config/INamedItemFactory.cs
index 28ce893aa0..5c5f3cd9ce 100644
--- a/src/NLog/Config/INamedItemFactory.cs
+++ b/src/NLog/Config/INamedItemFactory.cs
@@ -34,6 +34,7 @@
namespace NLog.Config
{
using System;
+ using System.ComponentModel;
///
/// Obsolete since dynamic type loading is not compatible with publish as trimmed application. Replaced by .
@@ -42,6 +43,7 @@ namespace NLog.Config
/// Base type for each item instance.
/// Item definition type (typically ).
[Obsolete("Instead use NLog.LogManager.Setup().SetupExtensions(). Marked obsolete with NLog v5.2")]
+ [EditorBrowsable(EditorBrowsableState.Never)]
public interface INamedItemFactory
where TInstanceType : class
{
diff --git a/src/NLog/Config/LoggingConfigurationReloadedEventArgs.cs b/src/NLog/Config/LoggingConfigurationReloadedEventArgs.cs
index 971fc3cd95..8276d8fd73 100644
--- a/src/NLog/Config/LoggingConfigurationReloadedEventArgs.cs
+++ b/src/NLog/Config/LoggingConfigurationReloadedEventArgs.cs
@@ -36,11 +36,13 @@
namespace NLog.Config
{
using System;
+ using System.ComponentModel;
///
/// Obsolete and replaced by and with NLog v5.2.
///
[Obsolete("Replaced by ConfigurationChanged, but check args.ActivatedConfiguration != null. Marked obsolete on NLog 5.2")]
+ [EditorBrowsable(EditorBrowsableState.Never)]
public class LoggingConfigurationReloadedEventArgs : EventArgs
{
///
diff --git a/src/NLog/Config/SimpleConfigurator.cs b/src/NLog/Config/SimpleConfigurator.cs
index 6d2916f0a5..85cd659d1e 100644
--- a/src/NLog/Config/SimpleConfigurator.cs
+++ b/src/NLog/Config/SimpleConfigurator.cs
@@ -34,6 +34,7 @@
namespace NLog.Config
{
using System;
+ using System.ComponentModel;
using NLog.Internal;
using NLog.Targets;
@@ -45,6 +46,7 @@ namespace NLog.Config
/// Warning, these methods will overwrite the current config.
///
[Obsolete("Use LogManager.Setup().LoadConfiguration() instead. Marked obsolete on NLog 5.2")]
+ [EditorBrowsable(EditorBrowsableState.Never)]
public static class SimpleConfigurator
{
#if !NETSTANDARD1_3
@@ -55,6 +57,7 @@ public static class SimpleConfigurator
/// the level are output to the console.
///
[Obsolete("Use LogManager.Setup().LoadConfiguration(c => c.ForLogger().WriteToConsole()) instead. Marked obsolete on NLog 5.2")]
+ [EditorBrowsable(EditorBrowsableState.Never)]
public static void ConfigureForConsoleLogging()
{
ConfigureForConsoleLogging(LogLevel.Info);
@@ -68,6 +71,7 @@ public static void ConfigureForConsoleLogging()
///
/// The minimal logging level.
[Obsolete("Use LogManager.Setup().LoadConfiguration(c => c.ForLogger(minLevel).WriteToConsole()) instead. Marked obsolete on NLog 5.2")]
+ [EditorBrowsable(EditorBrowsableState.Never)]
public static void ConfigureForConsoleLogging(LogLevel minLevel)
{
ConsoleTarget consoleTarget = new ConsoleTarget();
@@ -86,6 +90,7 @@ public static void ConfigureForConsoleLogging(LogLevel minLevel)
///
/// The target to log all messages to.
[Obsolete("Use LogManager.Setup().LoadConfiguration(c => c.ForLogger().WriteTo(target)) instead. Marked obsolete on NLog 5.2")]
+ [EditorBrowsable(EditorBrowsableState.Never)]
public static void ConfigureForTargetLogging(Target target)
{
Guard.ThrowIfNull(target);
@@ -101,6 +106,7 @@ public static void ConfigureForTargetLogging(Target target)
/// The target to log all messages to.
/// The minimal logging level.
[Obsolete("Use LogManager.Setup().LoadConfiguration(c => c.ForLogger(minLevel).WriteTo(target)) instead. Marked obsolete on NLog 5.2")]
+ [EditorBrowsable(EditorBrowsableState.Never)]
public static void ConfigureForTargetLogging(Target target, LogLevel minLevel)
{
Guard.ThrowIfNull(target);
@@ -117,6 +123,7 @@ public static void ConfigureForTargetLogging(Target target, LogLevel minLevel)
///
/// Log file name.
[Obsolete("Use LogManager.Setup().LoadConfiguration(c => c.ForLogger().WriteToFile(fileName)) instead. Marked obsolete on NLog 5.2")]
+ [EditorBrowsable(EditorBrowsableState.Never)]
public static void ConfigureForFileLogging(string fileName)
{
ConfigureForFileLogging(fileName, LogLevel.Info);
@@ -131,6 +138,7 @@ public static void ConfigureForFileLogging(string fileName)
/// Log file name.
/// The minimal logging level.
[Obsolete("Use LogManager.Setup().LoadConfiguration(c => c.ForLogger(minLevel).WriteToFile(fileName)) instead. Marked obsolete on NLog 5.2")]
+ [EditorBrowsable(EditorBrowsableState.Never)]
public static void ConfigureForFileLogging(string fileName, LogLevel minLevel)
{
FileTarget target = new FileTarget();
diff --git a/src/NLog/Config/ThreadSafeAttribute.cs b/src/NLog/Config/ThreadSafeAttribute.cs
index 43dbadb55b..fb2a43ec70 100644
--- a/src/NLog/Config/ThreadSafeAttribute.cs
+++ b/src/NLog/Config/ThreadSafeAttribute.cs
@@ -34,6 +34,7 @@
namespace NLog.Config
{
using System;
+ using System.ComponentModel;
///
/// Marks the layout or layout renderer as thread safe - it producing correct results
@@ -43,6 +44,7 @@ namespace NLog.Config
///
[Obsolete("All LayoutRenderer's and Layout's should be ThreadSafe by default. Marked obsolete with NLog 5.0")]
[AttributeUsage(AttributeTargets.Class)]
+ [EditorBrowsable(EditorBrowsableState.Never)]
public sealed class ThreadSafeAttribute : Attribute
{
}
diff --git a/src/NLog/Fluent/Log.cs b/src/NLog/Fluent/Log.cs
index 97f4eca24f..7f13b516a1 100644
--- a/src/NLog/Fluent/Log.cs
+++ b/src/NLog/Fluent/Log.cs
@@ -36,6 +36,7 @@
namespace NLog.Fluent
{
using System;
+ using System.ComponentModel;
using System.IO;
using System.Runtime.CompilerServices;
using NLog.Common;
@@ -43,6 +44,8 @@ namespace NLog.Fluent
///
/// A global logging class using caller info to find the logger.
///
+ [Obsolete("Obsoleted since it allocates unnecessary. Instead use ILogger.ForLogEvent and LogEventBuilder. Obsoleted in NLog 5.3")]
+ [EditorBrowsable(EditorBrowsableState.Never)]
public static class Log
{
[Obsolete("Obsoleted since it allocates unnecessary. Instead use ILogger.ForLogEvent and LogEventBuilder. Obsoleted in NLog 5.0")]
@@ -57,6 +60,7 @@ public static class Log
/// The full path of the source file that contains the caller. This is the file path at the time of compile.
/// An instance of the fluent .
[Obsolete("Obsoleted since it allocates unnecessary. Instead use ILogger.ForLogEvent and LogEventBuilder. Obsoleted in NLog 5.0")]
+ [EditorBrowsable(EditorBrowsableState.Never)]
public static LogBuilder Level(LogLevel logLevel, [CallerFilePath]string callerFilePath = null)
{
return Create(logLevel, callerFilePath);
@@ -70,6 +74,7 @@ public static LogBuilder Level(LogLevel logLevel, [CallerFilePath]string callerF
/// The full path of the source file that contains the caller. This is the file path at the time of compile.
/// An instance of the fluent .
[Obsolete("Obsoleted since it allocates unnecessary. Instead use ILogger.ForLogEvent and LogEventBuilder. Obsoleted in NLog 5.0")]
+ [EditorBrowsable(EditorBrowsableState.Never)]
public static LogBuilder Trace([CallerFilePath]string callerFilePath = null)
{
return Create(LogLevel.Trace, callerFilePath);
@@ -83,6 +88,7 @@ public static LogBuilder Trace([CallerFilePath]string callerFilePath = null)
/// The full path of the source file that contains the caller. This is the file path at the time of compile.
/// An instance of the fluent .
[Obsolete("Obsoleted since it allocates unnecessary. Instead use ILogger.ForLogEvent and LogEventBuilder. Obsoleted in NLog 5.0")]
+ [EditorBrowsable(EditorBrowsableState.Never)]
public static LogBuilder Debug([CallerFilePath]string callerFilePath = null)
{
return Create(LogLevel.Debug, callerFilePath);
@@ -96,6 +102,7 @@ public static LogBuilder Debug([CallerFilePath]string callerFilePath = null)
/// The full path of the source file that contains the caller. This is the file path at the time of compile.
/// An instance of the fluent .
[Obsolete("Obsoleted since it allocates unnecessary. Instead use ILogger.ForLogEvent and LogEventBuilder. Obsoleted in NLog 5.0")]
+ [EditorBrowsable(EditorBrowsableState.Never)]
public static LogBuilder Info([CallerFilePath]string callerFilePath = null)
{
return Create(LogLevel.Info, callerFilePath);
@@ -109,6 +116,7 @@ public static LogBuilder Info([CallerFilePath]string callerFilePath = null)
/// The full path of the source file that contains the caller. This is the file path at the time of compile.
/// An instance of the fluent .
[Obsolete("Obsoleted since it allocates unnecessary. Instead use ILogger.ForLogEvent and LogEventBuilder. Obsoleted in NLog 5.0")]
+ [EditorBrowsable(EditorBrowsableState.Never)]
public static LogBuilder Warn([CallerFilePath]string callerFilePath = null)
{
return Create(LogLevel.Warn, callerFilePath);
@@ -122,6 +130,7 @@ public static LogBuilder Warn([CallerFilePath]string callerFilePath = null)
/// The full path of the source file that contains the caller. This is the file path at the time of compile.
/// An instance of the fluent .
[Obsolete("Obsoleted since it allocates unnecessary. Instead use ILogger.ForLogEvent and LogEventBuilder. Obsoleted in NLog 5.0")]
+ [EditorBrowsable(EditorBrowsableState.Never)]
public static LogBuilder Error([CallerFilePath]string callerFilePath = null)
{
return Create(LogLevel.Error, callerFilePath);
@@ -135,12 +144,14 @@ public static LogBuilder Error([CallerFilePath]string callerFilePath = null)
/// The full path of the source file that contains the caller. This is the file path at the time of compile.
/// An instance of the fluent .
[Obsolete("Obsoleted since it allocates unnecessary. Instead use ILogger.ForLogEvent and LogEventBuilder. Obsoleted in NLog 5.0")]
+ [EditorBrowsable(EditorBrowsableState.Never)]
public static LogBuilder Fatal([CallerFilePath]string callerFilePath = null)
{
return Create(LogLevel.Fatal, callerFilePath);
}
[Obsolete("Obsoleted since it allocates unnecessary. Instead use ILogger.ForLogEvent and LogEventBuilder. Obsoleted in NLog 5.0")]
+ [EditorBrowsable(EditorBrowsableState.Never)]
private static LogBuilder Create(LogLevel logLevel, string callerFilePath)
{
var logger = GetLogger(callerFilePath);
diff --git a/src/NLog/Fluent/LogBuilder.cs b/src/NLog/Fluent/LogBuilder.cs
index 8efa984b50..18d06c363b 100644
--- a/src/NLog/Fluent/LogBuilder.cs
+++ b/src/NLog/Fluent/LogBuilder.cs
@@ -47,6 +47,7 @@ namespace NLog.Fluent
/// A fluent class to build log events for NLog.
///
[Obsolete("Obsoleted since it allocates unnecessary. Instead use ILogger.ForLogEvent and LogEventBuilder. Obsoleted in NLog 5.0")]
+ [EditorBrowsable(EditorBrowsableState.Never)]
public class LogBuilder
{
private readonly LogEventInfo _logEvent;
diff --git a/src/NLog/Fluent/LoggerExtensions.cs b/src/NLog/Fluent/LoggerExtensions.cs
index 96f5571444..22c0592506 100644
--- a/src/NLog/Fluent/LoggerExtensions.cs
+++ b/src/NLog/Fluent/LoggerExtensions.cs
@@ -31,6 +31,7 @@
// THE POSSIBILITY OF SUCH DAMAGE.
//
using System;
+using System.ComponentModel;
namespace NLog.Fluent
{
@@ -49,6 +50,7 @@ public static class LoggerExtensions
/// current for chaining calls.
[CLSCompliant(false)]
[Obsolete("Obsoleted since it allocates unnecessary. Instead use ILogger.ForLogEvent and LogEventBuilder. Obsoleted in NLog 5.0")]
+ [EditorBrowsable(EditorBrowsableState.Never)]
public static LogBuilder Log(this ILogger logger, LogLevel logLevel)
{
var builder = new LogBuilder(logger, logLevel);
@@ -64,6 +66,7 @@ public static LogBuilder Log(this ILogger logger, LogLevel logLevel)
/// current for chaining calls.
[CLSCompliant(false)]
[Obsolete("Obsoleted since it allocates unnecessary. Instead use ILogger.ForTraceEvent() and LogEventBuilder. Obsoleted in NLog 5.0")]
+ [EditorBrowsable(EditorBrowsableState.Never)]
public static LogBuilder Trace(this ILogger logger)
{
var builder = new LogBuilder(logger, LogLevel.Trace);
@@ -79,6 +82,7 @@ public static LogBuilder Trace(this ILogger logger)
/// current for chaining calls.
[CLSCompliant(false)]
[Obsolete("Obsoleted since it allocates unnecessary. Instead use ILogger.ForDebugEvent() and LogEventBuilder. Obsoleted in NLog 5.0")]
+ [EditorBrowsable(EditorBrowsableState.Never)]
public static LogBuilder Debug(this ILogger logger)
{
var builder = new LogBuilder(logger, LogLevel.Debug);
@@ -94,6 +98,7 @@ public static LogBuilder Debug(this ILogger logger)
/// current for chaining calls.
[CLSCompliant(false)]
[Obsolete("Obsoleted since it allocates unnecessary. Instead use ILogger.ForInfoEvent() and LogEventBuilder. Obsoleted in NLog 5.0")]
+ [EditorBrowsable(EditorBrowsableState.Never)]
public static LogBuilder Info(this ILogger logger)
{
var builder = new LogBuilder(logger, LogLevel.Info);
@@ -109,6 +114,7 @@ public static LogBuilder Info(this ILogger logger)
/// current for chaining calls.
[CLSCompliant(false)]
[Obsolete("Obsoleted since it allocates unnecessary. Instead use ILogger.ForWarnEvent() and LogEventBuilder. Obsoleted in NLog 5.0")]
+ [EditorBrowsable(EditorBrowsableState.Never)]
public static LogBuilder Warn(this ILogger logger)
{
var builder = new LogBuilder(logger, LogLevel.Warn);
@@ -124,6 +130,7 @@ public static LogBuilder Warn(this ILogger logger)
/// current for chaining calls.
[CLSCompliant(false)]
[Obsolete("Obsoleted since it allocates unnecessary. Instead use ILogger.ForErrorEvent() and LogEventBuilder. Obsoleted in NLog 5.0")]
+ [EditorBrowsable(EditorBrowsableState.Never)]
public static LogBuilder Error(this ILogger logger)
{
var builder = new LogBuilder(logger, LogLevel.Error);
@@ -139,6 +146,7 @@ public static LogBuilder Error(this ILogger logger)
/// current for chaining calls.
[CLSCompliant(false)]
[Obsolete("Obsoleted since it allocates unnecessary. Instead use ILogger.ForFatalEvent() and LogEventBuilder. Obsoleted in NLog 5.0")]
+ [EditorBrowsable(EditorBrowsableState.Never)]
public static LogBuilder Fatal(this ILogger logger)
{
var builder = new LogBuilder(logger, LogLevel.Fatal);
diff --git a/src/NLog/Internal/Abstractions/IAppDomain.cs b/src/NLog/Internal/Abstractions/IAppDomain.cs
index c0d874f98e..5bf5aa274d 100644
--- a/src/NLog/Internal/Abstractions/IAppDomain.cs
+++ b/src/NLog/Internal/Abstractions/IAppDomain.cs
@@ -36,11 +36,13 @@ namespace NLog.Internal.Fakeables
using System;
using System.Reflection;
using System.Collections.Generic;
+ using System.ComponentModel;
///
/// Interface for fakeable of the current AppDomain.
///
[Obsolete("For unit testing only. Marked obsolete on NLog 5.0")]
+ [EditorBrowsable(EditorBrowsableState.Never)]
public interface IAppDomain
{
///
diff --git a/src/NLog/LayoutRenderers/ApplicationEnvironment/AppSettingLayoutRenderer.cs b/src/NLog/LayoutRenderers/ApplicationEnvironment/AppSettingLayoutRenderer.cs
index f87cb8b5da..9bc2a2a24a 100644
--- a/src/NLog/LayoutRenderers/ApplicationEnvironment/AppSettingLayoutRenderer.cs
+++ b/src/NLog/LayoutRenderers/ApplicationEnvironment/AppSettingLayoutRenderer.cs
@@ -36,6 +36,7 @@
namespace NLog.LayoutRenderers
{
using System;
+ using System.ComponentModel;
using System.Text;
using NLog.Config;
using NLog.Internal;
@@ -70,6 +71,7 @@ public sealed class AppSettingLayoutRenderer : LayoutRenderer, IStringValueRende
/// The AppSetting item-name
///
[Obsolete("Allows easier conversion from NLog.Extended. Instead use Item-property. Marked obsolete in NLog 4.6")]
+ [EditorBrowsable(EditorBrowsableState.Never)]
public string Name { get => Item; set => Item = value; }
///
diff --git a/src/NLog/LogFactory.cs b/src/NLog/LogFactory.cs
index 00e28b5fd3..d53e42c7e8 100644
--- a/src/NLog/LogFactory.cs
+++ b/src/NLog/LogFactory.cs
@@ -1173,6 +1173,7 @@ internal Logger CreateNewLogger(Type loggerType, Func loggerCreato
/// Configuration file to be read
/// LogFactory instance for fluent interface
[Obsolete("Replaced by LogFactory.Setup().LoadConfigurationFromFile(). Marked obsolete on NLog 5.2")]
+ [EditorBrowsable(EditorBrowsableState.Never)]
public LogFactory LoadConfiguration(string configFile)
{
// TODO Remove explicit File-loading logic from LogFactory (Should handle environment without files)