diff --git a/DnsServerCore/Dns/Applications/DnsApplication.cs b/DnsServerCore/Dns/Applications/DnsApplication.cs index dbd27f08..ef1cb076 100644 --- a/DnsServerCore/Dns/Applications/DnsApplication.cs +++ b/DnsServerCore/Dns/Applications/DnsApplication.cs @@ -1,6 +1,6 @@ /* Technitium DNS Server -Copyright (C) 2024 Shreyas Zare (shreyas@technitium.com) +Copyright (C) 2025 Shreyas Zare (shreyas@technitium.com) This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -45,6 +45,7 @@ namespace DnsServerCore.Dns.Applications readonly IReadOnlyDictionary _dnsAuthoritativeRequestHandlers; readonly IReadOnlyDictionary _dnsRequestBlockingHandlers; readonly IReadOnlyDictionary _dnsQueryLoggers; + readonly IReadOnlyDictionary _dnsQueryLogs; readonly IReadOnlyDictionary _dnsPostProcessors; #endregion @@ -65,6 +66,7 @@ namespace DnsServerCore.Dns.Applications Dictionary dnsAuthoritativeRequestHandlers = new Dictionary(1); Dictionary dnsRequestBlockingHandlers = new Dictionary(1); Dictionary dnsQueryLoggers = new Dictionary(1); + Dictionary dnsQueryLogs = new Dictionary(1); Dictionary dnsPostProcessors = new Dictionary(1); foreach (Assembly appAssembly in _appContext.AppAssemblies) @@ -107,6 +109,9 @@ namespace DnsServerCore.Dns.Applications if (app is IDnsQueryLogger logger) dnsQueryLoggers.Add(classType.FullName, logger); + if (app is IDnsQueryLogs queryLogs) + dnsQueryLogs.Add(classType.FullName, queryLogs); + if (app is IDnsPostProcessor postProcessor) dnsPostProcessors.Add(classType.FullName, postProcessor); @@ -147,6 +152,7 @@ namespace DnsServerCore.Dns.Applications _dnsAuthoritativeRequestHandlers = dnsAuthoritativeRequestHandlers; _dnsRequestBlockingHandlers = dnsRequestBlockingHandlers; _dnsQueryLoggers = dnsQueryLoggers; + _dnsQueryLogs = dnsQueryLogs; _dnsPostProcessors = dnsPostProcessors; } @@ -263,6 +269,9 @@ namespace DnsServerCore.Dns.Applications public IReadOnlyDictionary DnsQueryLoggers { get { return _dnsQueryLoggers; } } + public IReadOnlyDictionary DnsQueryLogs + { get { return _dnsQueryLogs; } } + public IReadOnlyDictionary DnsPostProcessors { get { return _dnsPostProcessors; } }