https://jira.qos.ch/browse/LOGBACK-540 as a possible fix at a logback level, but note that this wouldn’t work for other logging frameworks supported by slf4j. A code fix is probably the most robust answer here.
Another approach to this ticket might be to allow a user to specify the type of JNI support they wish to use. This would address a problem that’s been raised on the Spark side re: the JNI dependency breaking the expectations of Spark packages. It would also address the underlying motivation for this ticket (since in the case cited by a user could specify “native Java” support and avoid the JNI checks all together), although admittedly it’s not a direct solution to this second point.