本文介绍了logstash找不到log4j2.properties文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我一直在尝试建立概念证明Elasticsearch/kibana/logstash环境,但目前无法正常工作.
I have been trying to setup a proof of concept elasticsearch/kibana/logstash environment, but it is not working at the moment.
LOGSTASH_HOME是:
The LOGSTASH_HOME is:
c:\_work\issues\log4j_socketappender\logstash-5.0.1\
在logstash的控制台日志中,我找到了以下行:
In the console log of logstash I found the following line:
Could not find log4j2 configuration at path /_work/issues/log4j_socketappender/logstash-5.0.1/config/log4j2.properties. Using default config which logs to console
您可以看到logstash试图在正确的位置查找log4j2.properties,但其中不包含"c:"部分
You can see logstash is trying to look for log4j2.properties in the right location but it does not contain the "c:" part
我尝试将路径添加到config \ jvm.options
I tried adding the path to the config\jvm.options
-Dlog4j.configurationFile=c:\_work\issues\log4j_socketappender\logstash-5.0.1\log4j2.properties
但是没有用.
推荐答案
最终,我通过将以下行添加到 bin \ setup.bat
Eventually I fixed it by adding the following line into bin\setup.bat
42. SET JAVA_OPTS=%JAVA_OPTS% -Dlog4j.configurationFile=%LS_HOME%\config\log4j2.properties
这篇关于logstash找不到log4j2.properties文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!