Fix NPE with clazz.getName() on logger with trace level enabled.