Here is an example of file pointing to a specific file instead of a folder.
### Set output encoding ###
Log4j. appender. logfile. Encoding = UTF-8
### Set log levels ###
Log4j. rootlogger = debug, stdout, d, e
### Out print at console ###
Log4j. appender. stdout = org. Apache. log4j. leleappender
Log4j. appender. stdout. Target = system. Out
Log4j. appender. stdout. layout = org. Apache. log4j. patternlayout
Log4j. appender. stdout. layout. conversionpattern = % d {absolute} % 5 P % c {1}: % L-% m % N
### Write in log ###
Log4j. appender. d = org. Apache. log4j. dailyrollingfileappender
Log4j. appender. D. File = logs/log. Log // it must be a specific file rather than a folder.
Log4j. appender. D. append = true
Log4j. appender. D. Threshold = debug
Log4j. appender. D. layout = org. Apache. log4j. patternlayout
Log4j. appender. d. layout. conversionpattern = %-d {yyyy-mm-dd hh: mm: SS} [% T: % R]-[% P] % m % N
### Save Error Log ###
Log4j. appender. E = org. Apache. log4j. dailyrollingfileappender
Log4j. appender. E. File = logs/error. Log // it must be a specific file rather than a folder.
Log4j. appender. E. append = true
Log4j. appender. E. Threshold = Error
Log4j. appender. E. layout = org. Apache. log4j. patternlayout
Log4j. appender. e. layout. conversionpattern = %-d {yyyy-mm-dd hh \: mm \: SS} [% t \: % R]-[% P] % m % N