Add logs and improvements

dev
Rajitha Kumara 1 year ago
parent 0c19b80891
commit b80e346bb3

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

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

@ -1,3 +1,23 @@
#!/bin/bash #!/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.dto.ValidationInfoDTO;
import io.entgra.token.validator.entities.Token; import io.entgra.token.validator.entities.Token;
import io.entgra.token.validator.exception.ValidationException; import io.entgra.token.validator.exception.ValidationException;
import org.apache.commons.logging.Log; import org.slf4j.Logger;
import org.apache.commons.logging.LogFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@ -15,7 +15,7 @@ import java.util.Objects;
@Service @Service
public class TokenService { public class TokenService {
private static final Log log = LogFactory.getLog(TokenService.class); private static final Logger log = LoggerFactory.getLogger(TokenService.class);
@Autowired @Autowired
public TokenDAO tokenDAO; public TokenDAO tokenDAO;

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