Hi Log4j2 have public API?Do we need to encapsulate it?
zhangleispring <[email protected]> 于2021年6月2日周三 下午4:32写道: > Hi, > it’s a good idea to judge the log level. > but if you want to user JAVA Lambda,you need to deal with this situation > for example: > Log.info(‘info:{},name:{},age:{}’,”info”,”name”,”18”) > if you want to use JAVA Lambda, Log4j2 is a good way > > > 在 2021年6月2日 15:46,翟伟<[email protected]> 写道: > > > I like this On 06/2/2021 15:36,XiaoYu<[email protected]> wrote: Hi > Community It is very appropriate to use the delayed nature of lambda > expressions to print logs. If we should print logs, like this : > `log.error("hello world"); ` If log level not config is ERROR, This `Java > String` is a loss to the program. Now if we used lambda expressions, like > this : `log.error(() -> "hello world ")` It will only output if the log > config is ERROR. Based on the above considerations, I created > `org.apache.shenyu.common.utils.LogUtils` This `LogUtils` use lambda > expressions to print logs. In the shenyu project, should we use it all for > printing logs? Looking forward to your suggestions! Thanks!
