Skip to content

Commit

Permalink
Filter out a messaging on Mac indicating that Netty falls back to the…
Browse files Browse the repository at this point in the history
… system DNS resolver
  • Loading branch information
cescoffier authored and igorregis committed Oct 16, 2022
1 parent 3f6a0c6 commit cbccd11
Showing 1 changed file with 14 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import org.jboss.logmanager.Level;

import io.netty.channel.EventLoopGroup;
import io.netty.resolver.dns.DnsServerAddressStreamProviders;
import io.netty.util.internal.PlatformDependent;
import io.netty.util.internal.logging.InternalLoggerFactory;
import io.quarkus.arc.deployment.AdditionalBeanBuildItem;
Expand Down Expand Up @@ -253,11 +254,23 @@ RuntimeInitializedClassBuildItem runtimeInitBcryptUtil() {
//if debug logging is enabled netty logs lots of exceptions
//see https://github.com/quarkusio/quarkus/issues/5213
@BuildStep
LogCleanupFilterBuildItem cleanup() {
LogCleanupFilterBuildItem cleanupUnsafeLog() {
return new LogCleanupFilterBuildItem(PlatformDependent.class.getName() + "0", Level.TRACE, "direct buffer constructor",
"jdk.internal.misc.Unsafe", "sun.misc.Unsafe");
}

/**
* On mac, if you do not have the `MacOSDnsServerAddressStreamProvider` class, Netty prints a warning saying it
* falls back to the default system DNS provider. This is not a problem and generates tons of questions.
*
* @return the log cleanup item removing the message
*/
@BuildStep
LogCleanupFilterBuildItem cleanupMacDNSInLog() {
return new LogCleanupFilterBuildItem(DnsServerAddressStreamProviders.class.getName(), Level.WARN,
"Can not find io.netty.resolver.dns.macos.MacOSDnsServerAddressStreamProvider in the classpath");
}

private String calculateMaxOrder(OptionalInt userConfig, List<MinNettyAllocatorMaxOrderBuildItem> minMaxOrderBuildItems,
boolean shouldWarn) {
int result = DEFAULT_NETTY_ALLOCATOR_MAX_ORDER;
Expand Down

0 comments on commit cbccd11

Please sign in to comment.