First of all, I tried every solution that exist, but nothing is working, so I don't want from anyone to say this question is duplicated.
I cannot log to the file using logback, but I can log to console without problems.
My logback.xml
file content:
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<!-- encoders are assigned the type
ch.qos.logback.classic.encoder.PatternLayoutEncoder by default -->
<encoder>
<pattern>%-4relative [%thread] %-5level %logger{35} - %msg %n</pattern>
</encoder>
</appender>
<appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
<!--See http://logback.qos.ch/manual/appenders.html#RollingFileAppender-->
<!--and http://logback.qos.ch/manual/appenders.html#TimeBasedRollingPolicy-->
<!--for further documentation-->
<append>true</append>
<File>/root/connector/logs/connector.log</File>
<encoder>
<!-- was: %d{yyyy-MM-dd HH:mm:ss}%5p [%t] (%F:%L) - %msg%n -->
<pattern>%d{yyyy-MM-dd HH:mm:ss} %-5level [%thread] \(%class{25}:%line\) - %msg%n</pattern>
</encoder>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<!-- By setting the name to .gz here, we get free compression. -->
<fileNamePattern>/root/connector/logs/connector.log.%d{yyyy-MM-dd}.gz</fileNamePattern>
</rollingPolicy>
</appender>
<root level="DEBUG">
<appender-ref ref="STDOUT" />
<appender-ref ref="FILE" />
</root>
</configuration>
I even tried to give all users the permission to write in the folder, but this doesn't work.
drwxrwxrwx. 2 nobody nobody 4096 Apr 29 08:24 logs
I repeat again, I tried every solution that exists, but nothing is working.