Add logs and improvements

dev
Rajitha Kumara 1 year ago
parent 0c19b80891
commit b80e346bb3

@ -41,6 +41,7 @@
<artifactId>maven-assembly-plugin</artifactId>
<version>3.6.0</version>
<configuration>
<appendAssemblyId>false</appendAssemblyId>
<descriptors>
<descriptor>src/main/assembly/bin.xml</descriptor>
</descriptors>
@ -91,9 +92,9 @@
</dependency>
<dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
<version>1.2</version>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.7.36</version>
</dependency>
</dependencies>

@ -1,6 +1,7 @@
<!-- Assemble migration-token-validator server -->
<assembly>
<id>bin</id>
<includeBaseDirectory>false</includeBaseDirectory>
<formats>
<format>zip</format>
</formats>
@ -13,6 +14,7 @@
<fileSet>
<directory>${project.basedir}/src/main/assembly</directory>
<outputDirectory>/logs</outputDirectory>
<directoryMode>0775</directoryMode>
<excludes>
<exclude>*/**</exclude>
</excludes>
@ -23,6 +25,7 @@
<outputDirectory>/bin</outputDirectory>
<destName>${project.artifactId}.jar</destName>
<source>${project.build.directory}/${project.artifactId}-${project.version}.jar</source>
<fileMode>0755</fileMode>
</file>
</files>
</assembly>

@ -1,3 +1,23 @@
#!/bin/bash
value_port='8081'
value_db_url='jdbc:mysql://localhost:3306/EN_MI'
value_db_username='root'
value_db_password='root'
java -jar migration-token-validator.jar
property_port='--server.port='
property_db_url='--spring.datasource.url='
property_db_username='--spring.datasource.username='
property_db_password='--spring.datasource.password='
property_log_path='--logging.file.path='
configs=($property_port$value_port \
$property_db_url$value_db_url \
$property_db_username$value_db_username \
$property_db_password$value_db_password)
for config in "${configs[@]}"; do
config_str="${config_str} ${config}"
done
# starting the validation sever
java -jar migration-token-validator.jar "$config_str"

@ -6,8 +6,8 @@ import io.entgra.token.validator.dto.TokenDTO;
import io.entgra.token.validator.dto.ValidationInfoDTO;
import io.entgra.token.validator.entities.Token;
import io.entgra.token.validator.exception.ValidationException;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@ -15,7 +15,7 @@ import java.util.Objects;
@Service
public class TokenService {
private static final Log log = LogFactory.getLog(TokenService.class);
private static final Logger log = LoggerFactory.getLogger(TokenService.class);
@Autowired
public TokenDAO tokenDAO;

@ -1,9 +1,9 @@
server.port=3001
server.port=8081
spring.jpa.hibernate.ddl-auto=none
spring.jpa.hibernate.naming.physical-strategy=org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl
spring.datasource.url=jdbc:mysql://localhost:3306/EN_MI
spring.datasource.username=root
spring.datasource.password=root
spring.jackson.property-naming-strategy=SNAKE_CASE
logging.path=/var/log
logging.file.max-history=5
logging.file.name=../logs/validator.log
spring.logging.file.max-history=5
Loading…
Cancel
Save