Browse Source

日志路径配置

zoro 10 months ago
parent
commit
0080836a46

+ 1 - 1
pom.xml

@@ -297,7 +297,7 @@
     </profiles>
 
     <build>
-        <finalName>ShipLockImport</finalName>
+        <finalName>PortDraw</finalName>
         <plugins>
             <plugin>
                 <groupId>org.springframework.boot</groupId>

+ 0 - 201
src/main/java/com/shcd/entity/ShorelineManage.java

@@ -1,201 +0,0 @@
-package com.shcd.entity;
-
-import com.baomidou.mybatisplus.annotation.TableField;
-import com.baomidou.mybatisplus.annotation.TableId;
-import com.baomidou.mybatisplus.annotation.TableName;
-import lombok.Data;
-import org.hibernate.validator.constraints.Length;
-
-import java.math.BigDecimal;
-import java.util.Date;
-
-/**
- *
- * @TableName SHORELINE_MANAGE
- */
-@Data
-@TableName("GHJG_CHANNEL.SHORELINE_MANAGE")
-public class ShorelineManage {
-
-    /**
-     *
-     */
-    @TableField("OBJECTID")
-    private Long objectid;
-    /**
-     *
-     */
-    @TableField("LINE_CODE")
-    private String lineCode;
-    /**
-     *
-     */
-    @TableField("EXEQUATUR_CODE")
-    private String exequaturCode;
-    /**
-     *
-     */
-    @TableField("LINE_APPROVE_TYPE")
-    private String lineApproveType;
-    /**
-     *
-     */
-    @TableField("CERTIFICATION_STATUS")
-    private String certificationStatus;
-    /**
-     *
-     */
-    @TableField("LINE_USER")
-    private String lineUser;
-    /**
-     *
-     */
-    @TableField("CONTACT_ADDRESS")
-    private String contactAddress;
-    /**
-     *
-     */
-    @TableField("LINE_LOCATION")
-    private String lineLocation;
-    /**
-     *
-     */
-    @TableField("APPROVED_LENGTH")
-    private BigDecimal approvedLength;
-    /**
-     *
-     */
-    @TableField("MTQYSH")
-    private String mtqysh;
-    /**
-     *
-     */
-    @TableField("MAIN_USE")
-    private String mainUse;
-    /**
-     *
-     */
-    @TableField("NEAR_UP_USER")
-    private String nearUpUser;
-    /**
-     *
-     */
-    @TableField("NEAR_DOWN_USER")
-    private String nearDownUser;
-    /**
-     *
-     */
-    @TableField("CARD_FILL_UNIT")
-    private String cardFillUnit;
-    /**
-     *
-     */
-    @TableField("AUTHORITY_ORZ")
-    private String authorityOrz;
-    /**
-     *
-     */
-    @TableField("ISSUE_DATE")
-    private Date issueDate;
-    /**
-     *
-     */
-    @TableField("EFFECTIVE_DATE")
-    private Date effectiveDate;
-    /**
-     *
-     */
-    @TableField("EFFECTIVE_YEAR")
-    private String effectiveYear;
-    /**
-     *
-     */
-    @TableField("BELONG_AREA")
-    private String belongArea;
-    /**
-     *
-     */
-    @TableField("BELONG_STATION")
-    private String belongStation;
-    /**
-     *
-     */
-    @TableField("MAJOR_WATER_AREA_FACILITY")
-    private String majorWaterAreaFacility;
-    /**
-     *
-     */
-    @TableField("CONTROL_A_X")
-    private String controlAX;
-    /**
-     *
-     */
-    @TableField("CONTROL_A_Y")
-    private String controlAY;
-    /**
-     *
-     */
-    @TableField("CONTROL_B_X")
-    private String controlBX;
-    /**
-     *
-     */
-    @TableField("CONTROL_B_Y")
-    private String controlBY;
-    /**
-     *
-     */
-    @TableField("EXPLAIN")
-    private String explain;
-    /**
-     *
-     */
-    @TableField("LONGITUDE")
-    private String longitude;
-    /**
-     *
-     */
-    @TableField("LATITUDE")
-    private String latitude;
-    /**
-     *
-     */
-    @TableField("REMARK")
-    private String remark;
-    /**
-     *
-     */
-    @TableField("BELONG_COUNTRY")
-    private String belongCountry;
-    /**
-     *
-     */
-    @TableField("UPDATE_STATUS")
-    private String updateStatus;
-    /**
-     *
-     */
-    @TableField("LOCATION")
-    private String location;
-    /**
-     *
-     */
-    @TableField("LINE_TYPE")
-    private String lineType;
-
-    @TableField("FBDATE")
-    private Date fbDate;
-    @TableField("SAVE_DATE")
-    private Date saveDate;
-    @TableField("IS_SUBMIT")
-    private Integer isSubmit;
-    @TableField("IS_UPDATE")
-    private Integer isUpdate;
-
-    @TableField("UPDATE_USER")
-    private String updateUser;
-    @TableField("ID")
-    private String id;
-    @TableId("CODE")
-    private String code;
-}

+ 2 - 1
src/main/java/com/shcd/mapper/PortDrawFlashMapper.java

@@ -1,6 +1,7 @@
 package com.shcd.mapper;
 
 import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
 
 import java.util.List;
 
@@ -9,5 +10,5 @@ public interface PortDrawFlashMapper {
 
     List<String> getAllNeedRemoveData();
 
-    void removeAllByIds(List<String> drawIds);
+    void removeAllByIds(@Param("drawIds") List<String> drawIds);
 }

+ 4 - 16
src/main/resources/profile/test/application.properties

@@ -35,9 +35,9 @@ spring.jmx.enabled=false
 
 #岸线更新
 xxl.job.admin.addresses=http://172.17.159.2:8091/xxl-job-admin
-xxl.job.executor.appname=ShipLock
-xxl.job.executor.ip=172.17.159.2
-xxl.job.executor.port=9994
+xxl.job.executor.appname=PortDraw
+xxl.job.executor.ip=127.0.0.1
+xxl.job.executor.port=9993
 xxl.job.accessToken=
 xxl.job.executor.logpath=E:/xxl-job/applogs/xxl-job
 xxl.job.executor.logretentiondays=30
@@ -59,16 +59,4 @@ spring.redis.jedis.pool.max-idle=10
 # 最小空闲
 spring.redis.jedis.pool.min-idle=-1
 # 连接超时时间
-spring.redis.timeout=10000
-
-
-shipLockDoorStatusUrl=http://172.31.233.22:8095/shipLock/xunxiang/ship/info/query/doorStatus
-shipLockSecretId=yangshuai
-shipLockSecretKey=rlDR2kzLkZ5mpJbUscF7Si9EnlLJWcAc3uCnIiZdAvfm9haipGiCBZ0GuyFypkSWQ2hVgpTgAu0MdgLfLw64TkOvTmKkleci0rgE55wQuck=
-illegalInfoUrl=http://172.31.233.22:8095/shipLock/xunxiang/ship/open/get-illegal-info?
-infoSecretId=durr
-infoSecretKey=WpEuxS+GyBzT0go10TGJeQjR5reA0LolEkmVzfmS87dU7H7LNP2xYsD1rmGgoEHx8ApuX8GaIPgZsUhOa8wJ+YkfkTsuMC74zMOVCyt5xOw=
-lockStaticUrl=http://172.31.233.22:8095/shipLock/xunxiang/ship/open/get-lock-statistic?
-shipStatusUrl=http://172.31.233.22:8095/shipLock/xunxiang/ship/open/get-ship-by-status?
-shipLockWaterLevelUrl=http://172.31.233.22:8095/shipLock/xunxiang/ship/info/query/newData
-areaStatisticUrl=http://172.31.233.22:8095/shipLock/xunxiang/ship/open/get-area-statistic
+spring.redis.timeout=10000

+ 8 - 60
src/main/resources/profile/test/logback-spring.xml

@@ -1,14 +1,9 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<!-- 日志级别从低到高分为TRACE < DEBUG < INFO < WARN < ERROR < FATAL,如果设置为WARN,则低于WARN的信息都不会输出 -->
-<!-- scan:当此属性设置为true时,配置文档如果发生改变,将会被重新加载,默认值为true -->
-<!-- scanPeriod:设置监测配置文档是否有修改的时间间隔,如果没有给出时间单位,默认单位是毫秒。
-                 当scan为true时,此属性生效。默认的时间间隔为1分钟。 -->
-<!-- debug:当此属性设置为true时,将打印出logback内部日志信息,实时查看logback运行状态。默认值为false。 -->
 <configuration  scan="true" scanPeriod="10 seconds">
     <contextName>logback</contextName>
 
     <!-- name的值是变量的名称,value的值时变量定义的值。通过定义的值会被插入到logger上下文中。定义后,可以使“${}”来使用变量。 -->
-    <property name="log.path" value="./logFiles" />
+    <property name="log.path" value="./logs" />
 
     <!--0. 日志格式和颜色渲染 -->
     <!-- 彩色日志依赖的渲染类 -->
@@ -23,7 +18,6 @@
         <!--此日志appender是为开发使用,只配置最底级别,控制台输出的日志级别是大于或等于此级别的日志信息-->
         <filter class="ch.qos.logback.classic.filter.ThresholdFilter">
             <level>debug</level>
-
         </filter>
         <encoder>
             <Pattern>${CONSOLE_LOG_PATTERN}</Pattern>
@@ -50,7 +44,7 @@
                 <maxFileSize>100MB</maxFileSize>
             </timeBasedFileNamingAndTriggeringPolicy>
             <!--日志文档保留天数-->
-            <maxHistory>5</maxHistory>
+            <maxHistory>2</maxHistory>
         </rollingPolicy>
         <!-- 此日志文档只记录debug级别的 -->
         <filter class="ch.qos.logback.classic.filter.LevelFilter">
@@ -74,10 +68,10 @@
             <!-- 每天日志归档路径以及格式 -->
             <fileNamePattern>${log.path}/web-info-%d{yyyy-MM-dd}.%i.log</fileNamePattern>
             <timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
-                <maxFileSize>20MB</maxFileSize>
+                <maxFileSize>100MB</maxFileSize>
             </timeBasedFileNamingAndTriggeringPolicy>
             <!--日志文档保留天数-->
-            <maxHistory>10</maxHistory>
+            <maxHistory>30</maxHistory>
         </rollingPolicy>
         <!-- 此日志文档只记录info级别的 -->
         <filter class="ch.qos.logback.classic.filter.LevelFilter">
@@ -100,10 +94,10 @@
         <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
             <fileNamePattern>${log.path}/web-warn-%d{yyyy-MM-dd}.%i.log</fileNamePattern>
             <timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
-                <maxFileSize>20MB</maxFileSize>
+                <maxFileSize>100MB</maxFileSize>
             </timeBasedFileNamingAndTriggeringPolicy>
             <!--日志文档保留天数-->
-            <maxHistory>5</maxHistory>
+            <maxHistory>2</maxHistory>
         </rollingPolicy>
         <!-- 此日志文档只记录warn级别的 -->
         <filter class="ch.qos.logback.classic.filter.LevelFilter">
@@ -126,10 +120,10 @@
         <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
             <fileNamePattern>${log.path}/web-error-%d{yyyy-MM-dd}.%i.log</fileNamePattern>
             <timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
-                <maxFileSize>20MB</maxFileSize>
+                <maxFileSize>100MB</maxFileSize>
             </timeBasedFileNamingAndTriggeringPolicy>
             <!--日志文档保留天数-->
-            <maxHistory>5</maxHistory>
+            <maxHistory>30</maxHistory>
         </rollingPolicy>
         <!-- 此日志文档只记录ERROR级别的 -->
         <filter class="ch.qos.logback.classic.filter.LevelFilter">
@@ -139,42 +133,6 @@
         </filter>
     </appender>
 
-    <logger name="com.InterfaceServices.mapper" level="DEBUG" />
-    <logger name="io.lettuce.core.protocol" level="ERROR">
-        <appender-ref ref="ERROR_FILE" />
-    </logger>
-    <!--
-        <logger>用来设置某一个包或者具体的某一个类的日志打印级别、
-        以及指定<appender>。<logger>仅有一个name属性,
-        一个可选的level和一个可选的addtivity属性。
-        name:用来指定受此logger约束的某一个包或者具体的某一个类。
-        level:用来设置打印级别,大小写无关:TRACE, DEBUG, INFO, WARN, ERROR, ALL 和 OFF,
-              还有一个特俗值INHERITED或者同义词NULL,代表强制执行上级的级别。
-              如果未设置此属性,那么当前logger将会继承上级的级别。
-        addtivity:是否向上级logger传递打印信息。默认是true。
-        <logger name="org.springframework.web" level="info"/>
-        <logger name="org.springframework.scheduling.annotation.ScheduledAnnotationBeanPostProcessor" level="INFO"/>
-    -->
-
-    <!--
-        使用mybatis的时候,sql语句是debug下才会打印,而这里我们只配置了info,所以想要查看sql语句的话,有以下两种操作:
-        第一种把<root level="info">改成<root level="DEBUG">这样就会打印sql,不过这样日志那边会出现很多其他消息
-        第二种就是单独给dao下目录配置debug模式,代码如下,这样配置sql语句会打印,其他还是正常info级别:
-        【logging.level.org.mybatis=debug logging.level.dao=debug】
-     -->
-
-    <!--
-        root节点是必选节点,用来指定最基础的日志输出级别,只有一个level属性
-        level:用来设置打印级别,大小写无关:TRACE, DEBUG, INFO, WARN, ERROR, ALL 和 OFF,
-        不能设置为INHERITED或者同义词NULL。默认是DEBUG
-        可以包含零个或多个元素,标识这个appender将会添加到这个logger。
-    -->
-
-    <!-- 4. 最终的策略 -->
-    <!-- 4.1 开发环境:打印控制台-->
-    <!-- <springProfile name="dev">
-        <logger name="com.sdcm.pmp" level="debug"/>
-    </springProfile> -->
 
     <root level="info">
         <appender-ref ref="CONSOLE" />
@@ -184,15 +142,5 @@
         <appender-ref ref="ERROR_FILE" />
     </root>
 
-    <!-- 4.2 生产环境:输出到文档
-    <springProfile name="pro">
-        <root level="info">
-            <appender-ref ref="CONSOLE" />
-            <appender-ref ref="DEBUG_FILE" />
-            <appender-ref ref="INFO_FILE" />
-            <appender-ref ref="ERROR_FILE" />
-            <appender-ref ref="WARN_FILE" />
-        </root>
-    </springProfile> -->
 
 </configuration>