Open oravecm opened 9 months ago
@oravecm Are you aware that the default implementations of org.slf4j.Logger#atTrace()
, org.slf4j.Logger#atDebug()
, org.slf4j.Logger#atInfo()
etc. return an instance of NOPLoggingEventBuilder when the relevant level is disabled for current logger?
Thus, when DefaultLoggingEventBuilder#addArgument(Supplier<?> objectSupplier)
method calls objectSupplier.get()
, the event is certain to be logged.
DefaultLoggingEventBuilder addArgument with supplier should be executed an after calling log() not directly during "addArgument" calling, else it is same as constant value.
should be
Same behaviour is in "Log4jEventBuilder"