ILoggerFactory loggerFactory = LoggerFactory.Create(builder => { builder.AddConsole(); builder.AddContext(); }); ILogger logger = loggerFactory.CreateLogger("MyLogger"); logger.LogInformation("Hello, {User}", currentUser);In this example, the AddContext method is called to add contextual information to the logger instance. This contextual information can be used to provide additional context to log messages, such as the current user. The package library for ILoggerFactory and AddContext is Microsoft.Extensions.Logging.