I'm kind of confused.  Elasticsearch already has the logging dependency.  I get that logging while you have the lock could cause you to hold it for some synchronous action but if it is at debug or trace that is unlikely.