java - logback can generate files, but logs cannot be output to files?
怪我咯
怪我咯 2017-06-12 09:23:52
0
1
963

When developing in eclipse, files can be generated normally in windows, and info and debug logs can also be output. However, there is a problem when switching to the Linux environment. Files can only be generated, and the startup log can be printed. After the startup is completed, , subsequent logs cannot be output to the file.
logback.xml should be fine. I have the same configuration in another project, and logs can be printed normally, but not in new projects. Now I wonder if it is a permission issue in the Linux environment?

怪我咯
怪我咯

走同样的路,发现不同的人生

reply all(1)
漂亮男人

After struggling for a long time, I finally found the problem,

ClassPathResource classPathResource = new ClassPathResource("logback.xml");

This method can find the configuration file path in the windows environment. Because replace is used, the path is wrong. It can be corrected after modification.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template