By VadOs
I’m using log4j library in my Java Spring Project
When I run my web app on my local Windows machine everything goes ok.
When I deploy my application to Digital Ocean Ubuntu server I get runtime error which I can’t fix
logj4.properties file which I use for windows and everything runs ok
log4j.rootLogger=INFO, file
log4j.appender.file=org.apache.log4j.RollingFileAppender
log4j.appender.file.File=C:\\TMP\\log_file.log
log4j.appender.file.MaxFileSize=1MB
log4j.appender.file.layout=org.apache.log4j.PatternLayout
log4j.appender.file.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss} %-5p %c{1}:%L - %m%n
and logj4.properties file which I use for ubuntu and get runtime error
log4j.rootLogger=INFO, file
log4j.appender.file=org.apache.log4j.RollingFileAppender
log4j.appender.file.File=tmp/log_file.log
log4j.appender.file.MaxFileSize=1MB
log4j.appender.file.layout=org.apache.log4j.PatternLayout
log4j.appender.file.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss} %-5p %c{1}:%L - %m%n
ERROR
log4j:ERROR setFile(null,true) call failed. java.io.FileNotFoundException: TMP/log_file.log (Permission denied)
the application successfully creates empty log_file.log which is available for modifications from console and than the whole app crashes
No idea whether Digital Ocean even allows writing logs to arbitrary location
will appreciate much you advise
thank you
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
This question was answered by @VadOs:
solution is very simple as it often happens )) never put your app compiled with jdk 8 on tomcat 7 server )) thanks again. issue closed
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.