I am using spring boot and logback. I am able to log into file in my local environment with IDE (IntelliJ), but it fails to log on AWS EC2 redhat linux with a JBoss EAP 7.1. I tried to set the log file permission to 777
after it is created, but still not working. The way I start up the server is
sudo sh /home/ec2-user/jboss-eap-7.1/bin/standalone.sh
my logback-spring.xml
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<!--Local-->
<!--<property name="LOG_FOLDER" value="${user.dir}/log" />-->
<!--Server-->
<property name="LOG_FOLDER" value="/home/ec2-user/jboss-eap-7.1/applications/springboottest/log"/>
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
<level>INFO</level>
</filter>
<layout class="ch.qos.logback.classic.PatternLayout">
<Pattern>[%d{HH:mm:ss.SSS}] THREAD=[%6.-6X{threadID}] %-5level [%30.-30logger{0}] - %msg%n</Pattern>
</layout>
</appender>
<appender name="ALL" class="ch.qos.logback.core.rolling.RollingFileAppender">
<append>true</append>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<fileNamePattern>${LOG_FOLDER}/log.all.%d{yyyy-MM-dd}.log</fileNamePattern>
<maxHistory>60</maxHistory>
</rollingPolicy>
<encoder>
<pattern>[%d{HH:mm:ss.SSS}] THREAD=[%6.-6X{threadID}] %-5level [%30.-30logger{0}] - %msg%n</pattern>
</encoder>
</appender>
<root level="INFO">
<appender-ref ref="STDOUT"/>
<appender-ref ref="ALL"/>
</root>
</configuration>
Does anyone know why it cannot append to the file?
Any help is appreciated. Thanks