# NLog > [!WARNING] > NServiceBus.NLog is obsolete. NServiceBus is now providing support for logging libraries through the Microsoft.Extensions.Logging. Please see [Logging in .NET Core and ASP.NET Core](https://learn.microsoft.com/en-us/aspnet/core/fundamentals/logging/) for further details. ## Logging integration into the host When using NServiceBus 10.2 or later with the [.NET Generic Host](/nservicebus/hosting/core-hosting.md), configure NLog directly on the host builder. The bridge package is not required: ```csharp var builder = Host.CreateApplicationBuilder(); builder.Logging.AddNLog(); builder.Services.AddNServiceBusEndpoint(endpointConfiguration); ``` For more information, see [Hosting with Microsoft.Extensions.Hosting](/nservicebus/hosting/core-hosting.md). ## Usage ```cs var config = new LoggingConfiguration(); var consoleTarget = new ColoredConsoleTarget { Layout = "${level}|${logger}|${message}${onexception:${newline}${exception:format=tostring}}" }; config.AddTarget("console", consoleTarget); config.LoggingRules.Add(new LoggingRule("*", LogLevel.Debug, consoleTarget)); LogManager.Configuration = config; NServiceBus.Logging.LogManager.Use(); ``` ## Filtering NServiceBus can write a significant amount of information to the log. To limit this information use the filtering features of the underlying logging framework. For example to limit log output to a specific namespace. Here is a code configuration example for adding a [Rule](https://github.com/nlog/NLog/wiki/Configuration-file#rules). ```cs var config = new LoggingConfiguration(); var target = new ColoredConsoleTarget(); config.AddTarget("console", target); config.LoggingRules.Add(new LoggingRule("MyNamespace.*", LogLevel.Debug, target)); LogManager.Configuration = config; NServiceBus.Logging.LogManager.Use(); ``` ## Additional exception data Starting from NServiceBus version 7.2, exceptions from message processing might contain additional error information in the `Exception.Data` property. Use the `Data` format property when configuring the exception layout, e.g. `${exception:format=toString,Data}`. For more information, see the [Exception layout renderer documentation](https://github.com/NLog/NLog/wiki/Exception-layout-renderer).