Error: “setFile(null,false) call failed” when using log4j

前端 未结 10 576
感情败类
感情败类 2020-12-15 15:37

I have added log4j.properties file in source folder of project but I am still getting a log4j:error.

Here is my Log4j.properties file:

          


        
相关标签:
10条回答
  • 2020-12-15 16:25

    this error is coming because of appender file location you have provided is not reachable with current user access.

    Quick Solution, change the log4j.appender.FILE.File setting to point to file using absolute path which location is reachable to the current user you have logged in, for example /tmp/myapp.log. Now You should not get an error.

    0 讨论(0)
  • Please changes your log file location to another drive. it will work.

    this happen's the permission of creating log file.

    0 讨论(0)
  • 2020-12-15 16:31

    I had the exact same problem. Here is the solution that worked for me: simply put your properties file path in the cmd line this way :

    -Dlog4j.configuration=<FILE_PATH>  (ex: log4j.properties)
    

    Hope this will help you

    0 讨论(0)
  • 2020-12-15 16:36

    To prevent this isue I changed all values in log4j.properties file with directory ${kafka.logs.dir} to my own directory. For example D:/temp/...

    0 讨论(0)
提交回复
热议问题