diff --git a/EOLib/Domain/Chat/ChatLoggerProvider.cs b/EOLib/Domain/Chat/ChatLoggerProvider.cs index 93fdbbc54..c6cc93bc2 100644 --- a/EOLib/Domain/Chat/ChatLoggerProvider.cs +++ b/EOLib/Domain/Chat/ChatLoggerProvider.cs @@ -1,4 +1,5 @@ using AutomaticTypeMapper; +using EOLib.Config; using EOLib.Logger; using System; @@ -14,9 +15,12 @@ public class ChatLoggerProvider : IChatLoggerProvider { public ILogger ChatLogger { get; } - public ChatLoggerProvider(ILoggerFactory loggerFactory) + public ChatLoggerProvider(IConfigurationProvider configurationProvider, ILoggerFactory loggerFactory) { - ChatLogger = loggerFactory.CreateLogger(Constants.ChatLogFile); + if (configurationProvider.LogChatToFile) + ChatLogger = loggerFactory.CreateLogger(Constants.ChatLogFile); + else + ChatLogger = loggerFactory.CreateLogger(); } public void Dispose()