我们如何将更高版本的 Log4j 设置为 grails 应用程序 [英] How can we set a higher version of Log4j to grails app

查看:23
本文介绍了我们如何将更高版本的 Log4j 设置为 grails 应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的 grails 应用程序中有我的 log4j 设置,版本为 2.4.3.我在 lib 文件夹中的 log4j 版本是 1.2.17(grails 2.4.3 的兼容版本).由于 log4j 漏洞利用问题,我需要将 log4j 版本升级到 2.16.0.如何进行必要的配置以将我现有的 grails 应用程序指向最新的 log4j?

I have my log4j settings in my grails app with version 2.4.3. And my log4j version inside the lib folder is 1.2.17 (the compatible version of grails 2.4.3). Due to the log4j exploit issue, I need to upgrade my log4j version to 2.16.0. How can I do the necessary configurations to point my existing grails app to the latest log4j?

推荐答案

在BuildConfig.groovy文件中,通过以下几行,可以升级log4j的版本,进入依赖"部分:

In BuildConfig.groovy file, with some that following lines, you can upgrade version of log4j, into "dependences" section:

compile 'org.apache.logging.log4j:log4j-core:2.16.0'

compile group: 'org.apache.logging.log4j', name: 'log4j-core', version: '2.16.0'

但是,当我添加依赖时,旧版本的log4j(1.2.17)并没有被删除,所以我不确定使用的是什么版本.

However, when I add dependence, the old version of log4j (1.2.17) is not deleted, so I´m not sure what version is using.

这篇关于我们如何将更高版本的 Log4j 设置为 grails 应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆