Log 4j properties file not found after converting it to Jar file.

Good Morning,
I am facing an issue when I convert my project into Exceutable jar file. It is not able able to find the log4j.properties file. Hoever when I keep my properties file along with executable file then it is able to read it.
I dont want to expose my properties file to user.
Could any one of you help me in identifying, how to do it?

Thank you.

Regards,
Ashwin Karangutkar
Test Engineer

Ashwin Train Asked on July 10, 2015 in Selenium WebDriver.
Add Comment
2 Answer(s)

While converting to jar you have to select the option to include the associated files with it. In eclipse you get that option on the right when you do Export > Jar > here on the right side of pop up window just tick the xml file

Virender

Virender Singh Professor Answered on July 10, 2015.

Hi Virender,
Thank you very much for quick reply. I am using properties file and not an xml file. However, I have properties file in Jar. But still gives me the same issue.

Could you please help me out?

Thank you.

on July 10, 2015.
Add Comment

A good thought at this shows that is it really reuqired for the log4j properties file to be hidden in jar?

if you hide it, it will anyway be overwritten by the properties supplied by the user. And it will also reduce the log managing capabilities of your system. Lets say you dont want to capture logs.

I hope I got your question right.

Virender Singh Professor Answered on July 10, 2015.

Hi Virender,

Ok. Considering your thought. I decided to keep my properties file along with Jar file outside. Now the issue I am facing is I am  taking path from user during run time which decides where the log files will be stored. However the path in properties file is getting updated but the log files are getting stored on hte same path.

Have you faced any similar issue.

Your  reply would be helpful

Thank you.

on July 10, 2015.
Add Comment

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.