diff --git a/.gitignore b/.gitignore index 41bad9a9..ee5cc7aa 100644 --- a/.gitignore +++ b/.gitignore @@ -38,4 +38,8 @@ out/ ### config yml ### -application-**.yml \ No newline at end of file +application-**.yml + + +### log ### +*.log \ No newline at end of file diff --git a/build.gradle b/build.gradle index 3378ed41..6b0f9f8f 100644 --- a/build.gradle +++ b/build.gradle @@ -48,6 +48,11 @@ dependencies { implementation 'io.springfox:springfox-boot-starter:3.0.0' implementation 'io.springfox:springfox-swagger-ui:3.0.0' + + // logback + implementation group: 'ch.qos.logback', name: 'logback-access', version: '1.2.9' + implementation group: 'ch.qos.logback', name: 'logback-core', version: '1.2.12' + testImplementation group: 'ch.qos.logback', name: 'logback-classic', version: '1.2.9' } tasks.named('test') { diff --git a/log/errorLog.log b/log/errorLog.log new file mode 100644 index 00000000..e69de29b diff --git a/log/warnLog.log b/log/warnLog.log new file mode 100644 index 00000000..e69de29b diff --git a/src/main/resources/logback-spring.xml b/src/main/resources/logback-spring.xml new file mode 100644 index 00000000..ea3d0d83 --- /dev/null +++ b/src/main/resources/logback-spring.xml @@ -0,0 +1,60 @@ + + + + + + + + + ${LOG_PATTERN} + + + + + + + ERROR + ACCEPT + DENY + + + ${LOG_PATH}/${ERROR_LOG_FILE_NAME}.log + + + ${LOG_PATTERN} + + + + ${LOG_PATH}/%d{yyyy-MM, aux}/${LOG_FILE_NAME}.%d{yyyy-MM-dd}.log + 2GB + + + + + + + + WARN + ACCEPT + DENY + + + ${LOG_PATH}/${WARN_LOG_FILE_NAME}.log + + + ${LOG_PATTERN} + + + + ${LOG_PATH}/%d{yyyy-MM, aux}/warnLog.%d{yyyy-MM-dd}.log + 2GB + + + + + + + + + + \ No newline at end of file