main
MonHun 2024-06-05 18:05:12 +09:00
parent faacc19a17
commit 03475b3a31
9 changed files with 128 additions and 1058 deletions

View File

@ -1 +1 @@
22952 18624

File diff suppressed because it is too large Load Diff

34
pom.xml
View File

@ -11,7 +11,7 @@
<groupId>kr.gmtc.gw</groupId> <groupId>kr.gmtc.gw</groupId>
<artifactId>asderecv</artifactId> <artifactId>asderecv</artifactId>
<version>0.0.1-SNAPSHOT</version> <version>0.0.1-SNAPSHOT</version>
<name>EyeGW_AsdeRecv</name> <name>EyeAPN_AsdeRecv</name>
<description>Demo project for Spring Boot</description> <description>Demo project for Spring Boot</description>
<repositories> <repositories>
@ -86,7 +86,7 @@
</dependencies> </dependencies>
<build> <build>
<finalName>EyeGW_AsdeRecv</finalName> <finalName>${project.name}</finalName>
<plugins> <plugins>
<plugin> <plugin>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
@ -95,6 +95,36 @@
<includeSystemScope>true</includeSystemScope> <includeSystemScope>true</includeSystemScope>
</configuration> </configuration>
</plugin> </plugin>
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<target>
<delete file="export/${project.name}.jar"/>
<delete file="export/cfg/application.yml"/>
<delete file="export/cfg/logback-spring.xml"/>
<copy file="target/${project.name}.jar" tofile="export/${project.name}.jar"/>
<copy file="src/main/resources/application.yml" tofile="export/cfg/application.yml" />
<copy file="src/main/resources/logback-spring.xml" tofile="export/cfg/logback-spring.xml" />
<copy file="cfg/udpsocket.xml" tofile="export/cfg/udpsocket.xml" />
<copy file="script/run.sh" tofile="export/run.sh" />
<copy file="script/start.sh" tofile="export/start.sh" />
<copy file="script/stop.sh" tofile="export/stop.sh" />
<copy file="script/tail.sh" tofile="export/tail.sh" />
</target>
</configuration>
</execution>
</executions>
</plugin>
</plugins> </plugins>
</build> </build>

View File

@ -25,6 +25,7 @@ import java.util.Map;
public class AsterixParser { public class AsterixParser {
private Logger logger; private Logger logger;
private Logger loggerParse;
private AsterixSpecLoader asterixSpec; private AsterixSpecLoader asterixSpec;
@ -58,6 +59,7 @@ public class AsterixParser {
private void initParser() { private void initParser() {
logger = LoggerFactory.getLogger(AsterixParser.class); logger = LoggerFactory.getLogger(AsterixParser.class);
loggerParse = LoggerFactory.getLogger("Parse_LOG");
fieldUtils = new FieldNameReflectionUtils(); fieldUtils = new FieldNameReflectionUtils();
apUtils = new AsterixParserUtils(); apUtils = new AsterixParserUtils();
@ -248,7 +250,7 @@ public class AsterixParser {
{ {
if(debugLogMode.equals("line")) if(debugLogMode.equals("line"))
logger.debug("parging 결과 :" + resultMap.toString()); loggerParse.trace("[CatNo:" + currentSpec.getCat() + "] " + resultMap.toString());
result.add(resultMap); result.add(resultMap);

View File

@ -83,7 +83,7 @@ public class AsterixParserThread {
serviceMap.clear(); serviceMap.clear();
kafkaProducer.sendASDEMessage(srcList); //kafkaProducer.sendASDEMessage(srcList);
for(int idx=0; idx<srcList.size(); idx++) { for(int idx=0; idx<srcList.size(); idx++) {
for(int qi=0; qi<scvQcount; qi++) { for(int qi=0; qi<scvQcount; qi++) {

View File

@ -33,6 +33,7 @@ import javax.annotation.Resource;
public class MainController implements ApplicationListener<ContextClosedEvent>{ public class MainController implements ApplicationListener<ContextClosedEvent>{
protected Logger logger; protected Logger logger;
protected Logger loggerRecv;
protected UDPManager udpManager; protected UDPManager udpManager;
@ -79,6 +80,7 @@ public class MainController implements ApplicationListener<ContextClosedEvent>{
this.serviceQueue = serviceQueue; this.serviceQueue = serviceQueue;
logger = LoggerFactory.getLogger(this.getClass()); logger = LoggerFactory.getLogger(this.getClass());
loggerRecv = LoggerFactory.getLogger("RECV_LOG");
} }
@Order(0) @Order(0)
@ -168,7 +170,8 @@ public class MainController implements ApplicationListener<ContextClosedEvent>{
packetQ.add(msg); packetQ.add(msg);
//logger.debug("[UDPDataIn] : " + msg); // ASDE Data 수신 로그
loggerRecv.trace(msg);
} catch (Exception e) { } catch (Exception e) {

View File

@ -4,7 +4,6 @@ import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter; import java.time.format.DateTimeFormatter;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
import java.util.LinkedList;
import java.util.List; import java.util.List;
import java.util.Queue; import java.util.Queue;
@ -15,7 +14,6 @@ import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.kafka.core.KafkaTemplate; import org.springframework.kafka.core.KafkaTemplate;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.core.JsonProcessingException;
@ -26,10 +24,6 @@ import kr.gmtc.gw.asderecv.rest.vo.SacpServiceHeader;
import kr.gmtc.gw.asderecv.rest.vo.SacpServiceVO; import kr.gmtc.gw.asderecv.rest.vo.SacpServiceVO;
import kr.gmtc.gw.asderecv.rest.vo.ServiceAsdeData; import kr.gmtc.gw.asderecv.rest.vo.ServiceAsdeData;
// import gmt.common.type.LogLevelType;
// import gmt.logger.GmtLogManager;
// import kr.gmtc.eyegw.rest.vo.ServiceAsdeData;
@Component("kafkaProducer") @Component("kafkaProducer")
public class KafkaProducer { public class KafkaProducer {

View File

@ -48,7 +48,7 @@ spring:
# detail = parsing 결과 상세 표시 # detail = parsing 결과 상세 표시
dev: dev:
debug: debug:
debugLogMode: none debugLogMode: line
root: D:\Workspace\Odroid_repository\EyeGW_AsdeRecv root: D:\Workspace\Odroid_repository\EyeGW_AsdeRecv

View File

@ -63,7 +63,65 @@
<!-- 로그파일 최대 보관주기, fileNamePattern 에 따라 일별, 월별, 년별--> <!-- 로그파일 최대 보관주기, fileNamePattern 에 따라 일별, 월별, 년별-->
<maxHistory>10</maxHistory> <maxHistory>10</maxHistory>
<!-- 아카이브 최대 용량 maxHistory 이후에 적용됨 --> <!-- 아카이브 최대 용량 maxHistory 이후에 적용됨 -->
<totalSizeCap>100GB</totalSizeCap> <totalSizeCap>300mb</totalSizeCap>
<!-- 시작시 정책 적용 여부 -->
<CleanHistoryOnStart>true</CleanHistoryOnStart>
</rollingPolicy>
</appender>
<!-- File에 로그 출력 세팅 -->
<appender name="RECV_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
<!-- 파일 경로 설정 -->
<file>${LOG_PATH}${PATH_SEPARATOR}recvlog${PATH_SEPARATOR}recvlog.log</file>
<!-- 출력패턴 설정-->
<layout class="ch.qos.logback.classic.PatternLayout">
<pattern>[%d{yyyy-MM-dd HH:mm:ss.SSS}] %msg%n</pattern>
</layout>
<!-- Rolling 정책 -->
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<!-- .gz,.zip 등을 넣으면 자동 일자별 로그파일 압축 -->
<fileNamePattern>${LOG_PATH}${PATH_SEPARATOR}recvlog${PATH_SEPARATOR}%d{yyyyMM}${PATH_SEPARATOR}%d{yyyyMMdd}.%i.log</fileNamePattern>
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
<maxFileSize>10MB</maxFileSize>
</timeBasedFileNamingAndTriggeringPolicy>
<!-- 로그파일 최대 보관주기(일) -->
<maxHistory>3</maxHistory>
<!-- 아카이브 최대 용량 maxHistory 이후에 적용됨 -->
<totalSizeCap>30MB</totalSizeCap>
<!-- 시작시 정책 적용 여부 -->
<CleanHistoryOnStart>true</CleanHistoryOnStart>
</rollingPolicy>
</appender>
<!-- File에 로그 출력 세팅 -->
<appender name="Parse_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
<!-- 파일 경로 설정 -->
<file>${LOG_PATH}${PATH_SEPARATOR}parselog${PATH_SEPARATOR}parse.log</file>
<!-- 출력패턴 설정-->
<layout class="ch.qos.logback.classic.PatternLayout">
<pattern>[%d{yyyy-MM-dd HH:mm:ss.SSS}] %msg%n</pattern>
</layout>
<!-- Rolling 정책 -->
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<!-- .gz,.zip 등을 넣으면 자동 일자별 로그파일 압축 -->
<fileNamePattern>${LOG_PATH}${PATH_SEPARATOR}parselog${PATH_SEPARATOR}%d{yyyyMM}${PATH_SEPARATOR}%d{yyyyMMdd}.%i.log</fileNamePattern>
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
<maxFileSize>10MB</maxFileSize>
</timeBasedFileNamingAndTriggeringPolicy>
<!-- 로그파일 최대 보관주기(일) -->
<maxHistory>3</maxHistory>
<!-- 아카이브 최대 용량 maxHistory 이후에 적용됨 -->
<totalSizeCap>30MB</totalSizeCap>
<!-- 시작시 정책 적용 여부 --> <!-- 시작시 정책 적용 여부 -->
<CleanHistoryOnStart>true</CleanHistoryOnStart> <CleanHistoryOnStart>true</CleanHistoryOnStart>
</rollingPolicy> </rollingPolicy>
@ -88,15 +146,25 @@
<!-- 로그 전역 세팅 --> <!-- 로그 전역 세팅 -->
<root level="INFO"> <!-- <root level="INFO">
<appender-ref ref="CONSOLE"/> <appender-ref ref="CONSOLE"/>
<appender-ref ref="FILE"/> <appender-ref ref="FILE"/>
</root> </root> -->
<!-- <logger name="kr.gmtc.gw" level="TRACE"> <logger name="kr.gmtc.gw" level="INFO">
<appender-ref ref="CONSOLE"/> <appender-ref ref="CONSOLE"/>
<appender-ref ref="FILE"/> <appender-ref ref="FILE"/>
</logger> --> </logger>
<logger name="RECV_LOG" level="TRACE">
<!-- <appender-ref ref="CONSOLE"/> -->
<appender-ref ref="RECV_FILE"/>
</logger>
<logger name="Parse_LOG" level="TRACE">
<!-- <appender-ref ref="CONSOLE"/> -->
<appender-ref ref="Parse_FILE"/>
</logger>
<!-- <logger name="kr.gmt.so" level="INFO"> <!-- <logger name="kr.gmt.so" level="INFO">
<appender-ref ref="CONSOLE"/> <appender-ref ref="CONSOLE"/>