Less noisy logging in DnsServerAddressStreamProviders
(#11031)
Motivation: It is not uncommon to run Netty on OS X without the specific `MacOSDnsServerAddressStreamProvider`. The current log message is too verbose because it prints a full stack trace on the console while a simple logging message would have been enough. Modifications: - Print a `WARN` message when `MacOSDnsServerAddressStreamProvider` class is not found; - Print a `ERROR` message with a stack trace when the class was found but could not be loaded due to some other reasons; Result: Less noise in logs.
This commit is contained in:
parent
95e4d6f3fe
commit
a1172bf9c6
@ -66,10 +66,12 @@ public final class DnsServerAddressStreamProviders {
|
|||||||
} else {
|
} else {
|
||||||
throw (Throwable) maybeProvider;
|
throw (Throwable) maybeProvider;
|
||||||
}
|
}
|
||||||
|
} catch (ClassNotFoundException cause) {
|
||||||
|
LOGGER.warn("Can not find {} in the classpath, fallback to system defaults. This may result in "
|
||||||
|
+ "incorrect DNS resolutions on MacOS.", MACOS_PROVIDER_CLASS_NAME);
|
||||||
} catch (Throwable cause) {
|
} catch (Throwable cause) {
|
||||||
LOGGER.warn(
|
LOGGER.error("Unable to load {}, fallback to system defaults. This may result in "
|
||||||
"Unable to load {}, fallback to system defaults. {}", MACOS_PROVIDER_CLASS_NAME,
|
+ "incorrect DNS resolutions on MacOS.", MACOS_PROVIDER_CLASS_NAME, cause);
|
||||||
"This may result in incorrect DNS resolutions on MacOS.", cause);
|
|
||||||
constructorHandle = null;
|
constructorHandle = null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user