Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BE] fix: 환경변수 관리 수정 #395

Merged
merged 3 commits into from
Aug 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 23 additions & 23 deletions backend/src/main/resources/logback-spring-dev.xml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<included>

<springProperty name="log_dir" source="logging.file.path"/>
<property resource="logback-variables.yml"/>
<springProperty name="LOG_DIR" source="logging.file.path"/>

<springProperty name="SLACK_WEBHOOK_URI" source="logging.slack.webhook-uri"/>
<appender name="SLACK" class="com.github.maricn.logback.SlackAppender">
<webhookUri>${DEV_SLACK_WEBHOOK_URI}</webhookUri>
<webhookUri>${dev_slack_webhook_uri}</webhookUri>
<layout class="ch.qos.logback.classic.PatternLayout">
<Pattern>${LOG_PATTERN}</Pattern>
<Pattern>${log_pattern}</Pattern>
</layout>
<username>open-macbook</username>
<iconEmoji>:face_with_symbols_on_mouth:</iconEmoji>
Expand All @@ -27,17 +27,17 @@
<onMatch>ACCEPT</onMatch>
<onMismatch>DENY</onMismatch>
</filter>
<file>${LOG_DIR}/info.log</file>
<file>${log_dir}/info.log</file>
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
<fileNamePattern>
${LOG_DIR}/info/info.%d{yyyy-MM-dd}_%i.log
${log_dir}/info/info.%d{yyyy-MM-dd}_%i.log
</fileNamePattern>
<maxFileSize>${DEV_FILE_SIZE}</maxFileSize>
<maxHistory>${DEV_FILE_MAX_HISTORY}</maxHistory>
<maxFileSize>${dev_file_size}</maxFileSize>
<maxHistory>${dev_file_max_history}</maxHistory>
</rollingPolicy>
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
<pattern>
${LOG_PATTERN}
${log_pattern}
</pattern>
<outputPatternAsHeader>true</outputPatternAsHeader>
</encoder>
Expand All @@ -49,17 +49,17 @@
<onMatch>ACCEPT</onMatch>
<onMismatch>DENY</onMismatch>
</filter>
<file>${LOG_DIR}/warn.log</file>
<file>${log_dir}/warn.log</file>
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
<fileNamePattern>
${LOG_DIR}/warn/%d{yyyy-MM-dd}_%i.log
${log_dir}/warn/%d{yyyy-MM-dd}_%i.log
</fileNamePattern>
<maxFileSize>${DEV_FILE_SIZE}</maxFileSize>
<maxHistory>${DEV_FILE_MAX_HISTORY}</maxHistory>
<maxFileSize>${dev_file_size}</maxFileSize>
<maxHistory>${dev_file_max_history}</maxHistory>
</rollingPolicy>
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
<pattern>
${LOG_PATTERN}
${log_pattern}
</pattern>
<outputPatternAsHeader>true</outputPatternAsHeader>
</encoder>
Expand All @@ -71,34 +71,34 @@
<onMatch>ACCEPT</onMatch>
<onMismatch>DENY</onMismatch>
</filter>
<file>${LOG_DIR}/error.log</file>
<file>${log_dir}/error.log</file>
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
<fileNamePattern>
${LOG_DIR}/error/%d{yyyy-MM-dd}_%i.log
${log_dir}/error/%d{yyyy-MM-dd}_%i.log
</fileNamePattern>
<maxFileSize>${DEV_FILE_SIZE}</maxFileSize>
<maxHistory>${DEV_FILE_MAX_HISTORY}</maxHistory>
<maxFileSize>${dev_file_size}</maxFileSize>
<maxHistory>${dev_file_max_history}</maxHistory>
</rollingPolicy>
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
<pattern>
${LOG_PATTERN}
${log_pattern}
</pattern>
<outputPatternAsHeader>true</outputPatternAsHeader>
</encoder>
</appender>

<appender name="QUERY_LOG" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${LOG_DIR}/query_log.log</file>
<file>${log_dir}/query_log.log</file>
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
<fileNamePattern>
${LOG_DIR}/query/%d{yyyy-MM-dd}_%i.log
${log_dir}/query/%d{yyyy-MM-dd}_%i.log
</fileNamePattern>
<maxFileSize>${DEV_FILE_SIZE}</maxFileSize>
<maxHistory>${DEV_FILE_MAX_HISTORY}</maxHistory>
<maxFileSize>10kb</maxFileSize>
<maxHistory>1</maxHistory>
</rollingPolicy>
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
<pattern>
${LOG_PATTERN}
${log_pattern}
</pattern>
<outputPatternAsHeader>true</outputPatternAsHeader>
</encoder>
Expand Down
36 changes: 18 additions & 18 deletions backend/src/main/resources/logback-spring-prod.xml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<included>

<springProperty name="log_dir" source="logging.file.path"/>
<property resource="logback-variables.yml"/>
<springProperty name="LOG_DIR" source="logging.file.path"/>

<springProperty name="SLACK_WEBHOOK_URI" source="logging.slack.webhook-uri"/>
<appender name="SLACK" class="com.github.maricn.logback.SlackAppender">
<webhookUri>${PROD_SLACK_WEBHOOK_URI}</webhookUri>
<webhookUri>${prod_slack_webhook_uri}</webhookUri>
<layout class="ch.qos.logback.classic.PatternLayout">
<Pattern>${LOG_PATTERN}</Pattern>
<Pattern>${log_pattern}</Pattern>
</layout>
<username>open-macbook</username>
<iconEmoji>:face_with_symbols_on_mouth:</iconEmoji>
Expand All @@ -27,17 +27,17 @@
<onMatch>ACCEPT</onMatch>
<onMismatch>DENY</onMismatch>
</filter>
<file>${LOG_DIR}/info.log</file>
<file>${log_dir}/info.log</file>
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
<fileNamePattern>
${LOG_DIR}/info/info.%d{yyyy-MM-dd}_%i.log
${log_dir}/info/info.%d{yyyy-MM-dd}_%i.log
</fileNamePattern>
<maxFileSize>${PROD_FILE_SIZE}</maxFileSize>
<maxHistory>${PROD_FILE_MAX_HISTORY}</maxHistory>
<maxFileSize>${prod_file_size}</maxFileSize>
<maxHistory>${prod_file_max_history}</maxHistory>
</rollingPolicy>
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
<pattern>
${LOG_PATTERN}
${log_pattern}
</pattern>
<outputPatternAsHeader>true</outputPatternAsHeader>
</encoder>
Expand All @@ -49,17 +49,17 @@
<onMatch>ACCEPT</onMatch>
<onMismatch>DENY</onMismatch>
</filter>
<file>${LOG_DIR}/warn.log</file>
<file>${log_dir}/warn.log</file>
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
<fileNamePattern>
${LOG_DIR}/warn/%d{yyyy-MM-dd}_%i.log
${log_dir}/warn/%d{yyyy-MM-dd}_%i.log
</fileNamePattern>
<maxFileSize>${PROD_FILE_SIZE}</maxFileSize>
<maxHistory>${PROD_FILE_MAX_HISTORY}</maxHistory>
<maxFileSize>${prod_file_size}</maxFileSize>
<maxHistory>${prod_file_max_history}</maxHistory>
</rollingPolicy>
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
<pattern>
${LOG_PATTERN}
${log_pattern}
</pattern>
<outputPatternAsHeader>true</outputPatternAsHeader>
</encoder>
Expand All @@ -71,17 +71,17 @@
<onMatch>ACCEPT</onMatch>
<onMismatch>DENY</onMismatch>
</filter>
<file>${LOG_DIR}/error.log</file>
<file>${log_dir}/error.log</file>
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
<fileNamePattern>
${LOG_DIR}/error/%d{yyyy-MM-dd}_%i.log
${log_dir}/error/%d{yyyy-MM-dd}_%i.log
</fileNamePattern>
<maxFileSize>${PROD_FILE_SIZE}</maxFileSize>
<maxHistory>${PROD_FILE_MAX_HISTORY}</maxHistory>
<maxFileSize>${prod_file_size}</maxFileSize>
<maxHistory>${prod_file_max_history}</maxHistory>
</rollingPolicy>
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
<pattern>
${LOG_PATTERN}
${log_pattern}
</pattern>
<outputPatternAsHeader>true</outputPatternAsHeader>
</encoder>
Expand Down
14 changes: 7 additions & 7 deletions backend/src/main/resources/logback-variables.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
LOG_PATTERN: { LOG_PATTERN }
DEV_SLACK_WEBHOOK_URI: { DEV_SLACK_WEBHOOK_URI }
DEV_FILE_SIZE: { DEV_FILE_SIZE }
DEV_FILE_MAX_HISTORY: { DEV_FILE_MAX_HISTORY }
PROD_SLACK_WEBHOOK_URI: { PROD_SLACK_WEBHOOK_URI }
PROD_FILE_SIZE: { PROD_FILE_SIZE }
PROD_FILE_MAX_HISTORY: { PROD_FILE_MAX_HISTORY }
log_pattern: { LOG_PATTERN }
dev_slack_webhook_uri: { DEV_SLACK_WEBHOOK_URI }
dev_file_size: { DEV_FILE_SIZE }
dev_file_max_history: { DEV_FILE_MAX_HISTORY }
prod_slack_webhook_uri: { PROD_SLACK_WEBHOOK_URI }
prod_file_size: { PROD_FILE_SIZE }
prod_file_max_history: { PROD_FILE_MAX_HISTORY }
Loading