+ 3
How to create log4j file outside of jar using cmd?
I created one console App in Eclipse Mars and It is working fine in Eclipse. If I do export jar of this project and execute through CMD then it is also working except log4j. So problem is log file is not creating outside of Jar. I have one solution that we can pass jvm argument like -Dlog4j.configuration=file:"/path" and getting log file. but I want to create log file without passing jvm argument. So Is there any alternative Solution?
7 Answers
+ 3
Eres In IDE it will work fine but if you call jar file then log file will not create because it will not find any appenders for logger and threw WARN meassage like... Please initialize the log4j system properly
+ 2
Eres, If I set -Dlog4j.configuratorClass then how will be change path of log file dynamically?
0
-Dlog4j.configuratorClass=com.foo.BarConfigurator
0
You can also use a configuration class instead of the properties or xml file.đ
0
The log files are not generated inside the logs folder which is under your project root folder right???
0
Have you tried putting it simply in the same folder as api.jar instead of inside the jar?
- 1
Hello everyone, I have a plan to learn java but a moment ago I found out that there is a vulnerability that has been detected and many malicious hackers are exploiting me, be careful! đđđđ«