프로젝트/졸업작품 - 인프라

4. TroubleShooting - dev 환경에서 로그 미출력 현상 발생

han1693516 2025. 7. 2. 11:02

 

local 환경에서는 로그가 정상적으로 출력되지만, dev 환경에서 애플리케이션을 실행하면 로그가 출력되지 않는 현상이 발생했다.  

"C:\Program Files\Java\jdk-17\bin\java.exe" -XX:TieredStopAtLevel=1 -Dspring.profiles.active=dev -Dspring.output.ansi.enabled=always -Dcom.sun.management.jmxremote -Dspring.jmx.enabled=true -Dspring.liveBeansView.mbeanDomain -Dspring.application.admin.enabled=true "-Dmanagement.endpoints.jmx.exposure.include=*" "-javaagent:C:\Program Files\JetBrains\IntelliJ IDEA 2024.3\lib\idea_rt.jar=53096:C:\Program Files\JetBrains\IntelliJ IDEA 2024.3\bin" -Dfile.encoding=UTF-8 -classpath C:\Users\han16\Desktop\home-protector\home-protector\out\production\classes;C:\Users\han16\Desktop\home-protector\home-protector\out\production\resources;C:\Users\han16\.gradle\caches\modules-2\files-2.1\org.projectlombok\lombok\1.18.36\5a30490a6e14977d97d9c73c924c1f1b5311ea95\lombok-1.18.36.jar;C:\Users\han16\.gradle\caches\modules-2\files-2.1\org.springframework.boot\spring-boot-starter-web\3.4.2\cf1c8efe77dccf221acf5f0ce9cc24c718c0ca44\spring-boot-starter-web-3.4.2.jar;C:\Users\han16\.gradle\caches\modules-2\files-2.1\org.springframework.boot\spring-boot-starter-validation\3.4.2\3195ea4da38b902a09bf192361800d4e43940465\spring-boot-starter-validation-3.4.2.jar;C:\Users\han16\.gradle\caches\modules-2\files-2.1\com.google.guava\guava\33.4.0-jre\3fcc0a259f724c7de54a6a55ea7e26d3d5c0cac\guava-33.4.0-jre.jar;C:\Users\han16\.gradle\caches\modules-2\files-2.1\org.apache.commons\commons-lang3\3.12.0\c6842c86792ff03b9f1d1fe2aab8dc23aa6c6f0e\commons-lang3-3.12.0.jar;C:\Users\han16\.gradle\caches\modules-2\files-2.1\org.springframework.boot\spring-boot-starter-security\3.4.2\b3102ed745b5e71f61bb5174c6a12275f0154dbb\spring-boot-starter-security-3.4.2.jar;C:\Users\han16\.gradle\caches\modules-2\files-2.1\io.jsonwebtoken\jjwt-impl\0.12.3\e850d2b3f53bd82355cd9ee1c471054aa602b320\jjwt-impl-0.12.3.jar;C:\Users\han16\.gradle\caches\modules-2\files-2.1\io.jsonwebtoken\jjwt-jackson\0.12.3\5e6d0e45441547d892d3273a4ce5dd042e91d162\jjwt-jackson-0.12.3.jar;C:\Users\han16\.gradle\caches\modules-2\files-2.1\io.jsonwebtoken\jjwt-api\0.12.3\30b7de9176d17fa347eef14b85480825dab76b58\jjwt-api-0.12.3.jar;C:\Users\han16\.gradle\caches\modules-2\files-2.1\org.springframework.boot\spring-boot-starter-data-jpa\3.4.2\b65a304b493807dff48bf114135dc4aa5f267927\spring-boot-starter-data-jpa-3.4.2.jar;C:\Users\han16\.gradle\caches\modules-2\files-2.1\org.springframework.boot\spring-boot-starter-data-redis\3.4.2\ad0741d5a86b08ce449b4adb37e2287722d990a7\spring-boot-starter-data-redis-3.4.2.jar;C:\Users\han16\.gradle\caches\modules-2\files-2.1\org.springframework.boot\spring-boot-starter-actuator\3.4.2\667a1a4340d65ee7fde16f61ada4b3e35da9f566\spring-boot-starter-actuator-3.4.2.jar;C:\Users\han16\.gradle\caches\modules-2\files-2.1\io.sentry\sentry-spring-boot-starter-jakarta\8.3.0\56bab39b194775f4094e7a58d69571032a7fc6ee\sentry-spring-boot-starter-jakarta-8.3.0.jar;C:\Users\han16\.gradle\caches\modules-2\files-2.1\io.sentry\sentry-logback\8.3.0\e1c9e660d01ea62d485160ba43d175cffd190e83\sentry-logback-8.3.0.jar;C:\Users\han16\.gradle\caches\modules-2\files-2.1\io.sentry\sentry\8.3.0\d405ee28d4fe000f2cc6cf46d45db53aa6a7cc02\sentry-8.3.0.jar;C:\Users\han16\.gradle\caches\modules-2\files-2.1\org.springframework.boot\spring-boot-starter-json\3.4.2\e413d51228ddaf6a9644533987faa0ae6e18fe47\spring-boot-starter-json-3.4.2.jar;C:\Users\han16\.gradle\caches\modules-2\files-2.1\org.springframework.boot\spring-boot-starter\3.4.2\9d914208449fce99a67d3def60957cdcc98b552a\spring-boot-starter-3.4.2.jar;C:\Users\han16\.gradle\caches\modules-2\files-2.1\org.springframework\spring-webmvc\6.2.2\9b1aeb179ba9667bc78a4a5cec4ec8087db404d7\spring-webmvc-6.2.2.jar;C:\Users\han16\.gradle\caches\modules-2\files-2.1\org.springframework\spring-web\6.2.2\bd2ef98bf98b6ecf8dd29106ae27b7515524c21\spring-web-6.2.2.jar;C:\Users\han16\.gradle\caches\modules-2\files-2.1\org.springframework.boot\spring-boot-starter-tomcat\3.4.2\aa345bdd83adc80db5bc6ac4a711460396ad17ef\spring-boot-starter-tomcat-3.4.2.jar;C:\Users\han16\.gradle\caches\modules-2\files-2.1\org.apache.tomcat.embed\tomcat-embed-el\10.1.34\d2b2daca3bc999c62e58ae36b45ba0582530fb25\tomcat-embed-el-10.1.34.jar;C:\Users\han16\.gradle\caches\modules-2\files-2.1\org.hibernate.validator\hibernate-validator\8.0.2.Final\220e64815dd87535525331de20570017f899eb13\hibernate-validator-8.0.2.Final.jar;C:\Users\han16\.gradle\caches\modules-2\files-2.1\com.google.guava\failureaccess\1.0.2\c4a06a64e650562f30b7bf9aaec1bfed43aca12b\failureaccess-1.0.2.jar;C:\Users\han16\.gradle\caches\modules-2\files-2.1\com.google.guava\listenablefuture\9999.0-empty-to-avoid-conflict-with-guava\b421526c5f297295adef1c886e5246c39d4ac629\listenablefuture-9999.0-empty-to-avoid-conflict-with-guava.jar;C:\Users\han16\.gradle\caches\modules-2\files-2.1\com.google.code.findbugs\jsr305\3.0.2\25ea2e8b0c338a877313bd4672d3fe056ea78f0d\jsr305-3.0.2.jar;C:\Users\han16\.gradle\caches\modules-2\files-2.1\org.checkerframework\checker-qual\3.43.0\9425eee39e56b116d2b998b7c2cebcbd11a3c98b\checker-qual-3.43.0.jar;C:\Users\han16\.gradle\caches\modules-2\files-2.1\com.google.errorprone\error_prone_annotations\2.36.0\227d4d4957ccc3dc5761bd897e3a0ee587e750a7\error_prone_annotations-2.36.0.jar;C:\Users\han16\.gradle\caches\modules-2\files-2.1\com.google.j2objc\j2objc-annotations\3.0.0\7399e65dd7e9ff3404f4535b2f017093bdb134c7\j2objc-annotations-3.0.0.jar;C:\Users\han16\.gradle\caches\modules-2\files-2.1\org.springframework.security\spring-security-web\6.4.2\733a3bbbdca56225676fb7f4e3f317c2075fc383\spring-security-web-6.4.2.jar;C:\Users\han16\.gradle\caches\modules-2\files-2.1\org.springframework.security\spring-security-config\6.4.2\5ed985329eb14b1c61045160c8dcbbcab179ddd3\spring-security-config-6.4.2.jar;C:\Users\han16\.gradle\caches\modules-2\files-2.1\org.springframework\spring-aop\6.2.2\2a1a445d4cd8e5fe2311df04fc25c0bc54bd2ce4\spring-aop-6.2.2.jar;C:\Users\han16\.gradle\caches\modules-2\files-2.1\com.fasterxml.jackson.core\jackson-databind\2.18.2\deef8697b92141fb6caf7aa86966cff4eec9b04f\jackson-databind-2.18.2.jar;C:\Users\han16\.gradle\caches\modules-2\files-2.1\org.springframework.boot\spring-boot-starter-jdbc\3.4.2\a3698cab03ba6daaaa38c16df1b36c862e9e3e4b\spring-boot-starter-jdbc-3.4.2.jar;C:\Users\han16\.gradle\caches\modules-2\files-2.1\org.springframework.data\spring-data-jpa\3.4.2\4213f2d185b49447057823f5ef9de41e931f4f2e\spring-data-jpa-3.4.2.jar;C:\Users\han16\.gradle\caches\modules-2\files-2.1\org.hibernate.orm\hibernate-core\6.6.5.Final\c81deca40ebdb823d9f8a9e5dc5798a6a205626a\hibernate-core-6.6.5.Final.jar;C:\Users\han16\.gradle\caches\modules-2\files-2.1\org.springframework\spring-aspects\6.2.2\e9e0379bc353e43ab1cb326f413bb293d8a52e78\spring-aspects-6.2.2.jar;C:\Users\han16\.gradle\caches\modules-2\files-2.1\io.sentry\sentry-jdbc\8.3.0\80d46b1fb82052cabc5e79356f0eeed690f81e11\sentry-jdbc-8.3.0.jar;C:\Users\han16\.gradle\caches\modules-2\files-2.1\com.mysql\mysql-connector-j\9.1.0\5fb1d513278e1a9767dfa80ea9d8d7ee909f1a\mysql-connector-j-9.1.0.jar;C:\Users\han16\.gradle\caches\modules-2\files-2.1\org.springframework.data\spring-data-redis\3.4.2\f870c5c35ea80c1cc6dbfe3b4f665226cdfa2c3b\spring-data-redis-3.4.2.jar;C:\Users\han16\.gradle\caches\modules-2\files-2.1\io.lettuce\lettuce-core\6.4.2.RELEASE\8969c20697c74b71288d4d5e69b0fec4047d3d6d\lettuce-core-6.4.2.RELEASE.jar;C:\Users\han16\.gradle\caches\modules-2\files-2.1\org.springframework.boot\spring-boot-actuator-autoconfigure\3.4.2\d265afc28460f46189714e9c18e1cc5f94b953e3\spring-boot-actuator-autoconfigure-3.4.2.jar;C:\Users\han16\.gradle\caches\modules-2\files-2.1\io.micrometer\micrometer-jakarta9\1.14.3\a7611688d9290a647cc7fea5a1219ef4125d1e30\micrometer-jakarta9-1.14.3.jar;C:\Users\han16\.gradle\caches\modules-2\files-2.1\io.micrometer\micrometer-observation\1.14.3\cd66186a1fe8465dc732d9514bade1104044b56d\micrometer-observation-1.14.3.jar;C:\Users\han16\.gradle\caches\modules-2\files-2.1\io.sentry\sentry-spring-boot-jakarta\8.3.0\770b35d2bf7e89398d413805d3c595faf879d369\sentry-spring-boot-jakarta-8.3.0.jar;C:\Users\han16\.gradle\caches\modules-2\files-2.1\com.fasterxml.jackson.datatype\jackson-datatype-jsr310\2.18.2\7b6ff96adf421f4c6edbd694e797dd8fe434510a\jackson-datatype-jsr310-2.18.2.jar;C:\Users\han16\.gradle\caches\modules-2\files-2.1\com.fasterxml.jackson.module\jackson-module-parameter-names\2.18.2\72960cb3277347a748911d100c3302d60e8a616a\jackson-module-parameter-names-2.18.2.jar;C:\Users\han16\.gradle\caches\modules-2\files-2.1\com.fasterxml.jackson.datatype\jackson-datatype-jdk8\2.18.2\9ed6d538ebcc66864e114a7040953dce6ab6ea53\jackson-datatype-jdk8-2.18.2.jar;C:\Users\han16\.gradle\caches\modules-2\files-2.1\org.springframework.boot\spring-boot-starter-logging\3.4.2\be7631ab8d3cb2a6a3c9981dcaa6d0867c964772\spring-boot-starter-logging-3.4.2.jar;C:\Users\han16\.gradle\caches\modules-2\files-2.1\org.springframework.boot\spring-boot-autoconfigure\3.4.2\c50511dba751ffe7df320d27c6875feb2745654e\spring-boot-autoconfigure-3.4.2.jar;C:\Users\han16\.gradle\caches\modules-2\files-2.1\org.springframework.boot\spring-boot\3.4.2\b2514201ba6b838bd638a51619515501c5baefea\spring-boot-3.4.2.jar;C:\Users\han16\.gradle\caches\modules-2\files-2.1\org.springframework\spring-core\6.2.2\94269e888dc979e75a1a1b9600d7153d72e6a7f1\spring-core-6.2.2.jar;C:\Users\han16\.gradle\caches\modules-2\files-2.1\jakarta.annotation\jakarta.annotation-api\2.1.1\48b9bda22b091b1f48b13af03fe36db3be6e1ae3\jakarta.annotation-api-2.1.1.jar;C:\Users\han16\.gradle\caches\modules-2\files-2.1\org.yaml\snakeyaml\2.3\936b36210e27320f920536f695cf1af210c44586\snakeyaml-2.3.jar;C:\Users\han16\.gradle\caches\modules-2\files-2.1\org.springframework\spring-context\6.2.2\aa01a7faa3694983339ca7e45619860ef34052d6\spring-context-6.2.2.jar;C:\Users\han16\.gradle\caches\modules-2\files-2.1\org.springframework\spring-beans\6.2.2\ec8ee520ff7b147de8ac04d330848d468253f84d\spring-beans-6.2.2.jar;C:\Users\han16\.gradle\caches\modules-2\files-2.1\org.springframework\spring-expression\6.2.2\20164dd3a70d0048185cf02bb1b097b22e73d820\spring-expression-6.2.2.jar;C:\Users\han16\.gradle\caches\modules-2\files-2.1\org.apache.tomcat.embed\tomcat-embed-websocket\10.1.34\eef6d430f34b6e393b8d9e40f10db9043732b4e5\tomcat-embed-websocket-10.1.34.jar;C:\Users\han16\.gradle\caches\modules-2\files-2.1\org.apache.tomcat.embed\tomcat-embed-core\10.1.34\f610f84be607fbc82e393cc220f0ad45f92afc91\tomcat-embed-core-10.1.34.jar;C:\Users\han16\.gradle\caches\modules-2\files-2.1\jakarta.validation\jakarta.validation-api\3.0.2\92b6631659ba35ca09e44874d3eb936edfeee532\jakarta.validation-api-3.0.2.jar;C:\Users\han16\.gradle\caches\modules-2\files-2.1\org.jboss.logging\jboss-logging\3.6.1.Final\886afbb445b4016a37c8960a7aef6ebd769ce7e5\jboss-logging-3.6.1.Final.jar;C:\Users\han16\.gradle\caches\modules-2\files-2.1\com.fasterxml\classmate\1.7.0\e98374da1f2143ac8e6e0a95036994bb19137a3\classmate-1.7.0.jar;C:\Users\han16\.gradle\caches\modules-2\files-2.1\org.springframework.security\spring-security-core\6.4.2\51302b2af3f01eb79fdc7164a4cc3a3aa7e3b541\spring-security-core-6.4.2.jar;C:\Users\han16\.gradle\caches\modules-2\files-2.1\com.fasterxml.jackson.core\jackson-annotations\2.18.2\985d77751ebc7fce5db115a986bc9aa82f973f4a\jackson-annotations-2.18.2.jar;C:\Users\han16\.gradle\caches\modules-2\files-2.1\com.fasterxml.jackson.core\jackson-core\2.18.2\fb64ccac5c27dca8819418eb4e443a9f496d9ee7\jackson-core-2.18.2.jar;C:\Users\han16\.gradle\caches\modules-2\files-2.1\org.springframework\spring-jdbc\6.2.2\840572e748c1dfe7122e19a10888918e5ecfb631\spring-jdbc-6.2.2.jar;C:\Users\han16\.gradle\caches\modules-2\files-2.1\com.zaxxer\HikariCP\5.1.0\8c96e36c14461fc436bb02b264b96ef3ca5dca8c\HikariCP-5.1.0.jar;C:\Users\han16\.gradle\caches\modules-2\files-2.1\org.springframework\spring-orm\6.2.2\98d0c8e2f8f65b776b24ffa979e9802a0c7085d7\spring-orm-6.2.2.jar;C:\Users\han16\.gradle\caches\modules-2\files-2.1\org.springframework.data\spring-data-commons\3.4.2\387ff91a749cce404f7a6e4a15a3b75ff497bdbc\spring-data-commons-3.4.2.jar;C:\Users\han16\.gradle\caches\modules-2\files-2.1\org.springframework\spring-tx\6.2.2\91a2e378d0e457b9c500f2b30aaf8a7a422ba522\spring-tx-6.2.2.jar;C:\Users\han16\.gradle\caches\modules-2\files-2.1\org.antlr\antlr4-runtime\4.13.0\5a02e48521624faaf5ff4d99afc88b01686af655\antlr4-runtime-4.13.0.jar;C:\Users\han16\.gradle\caches\modules-2\files-2.1\org.slf4j\slf4j-api\2.0.16\172931663a09a1fa515567af5fbef00897d3c04\slf4j-api-2.0.16.jar;C:\Users\han16\.gradle\caches\modules-2\files-2.1\jakarta.persistence\jakarta.persistence-api\3.1.0\66901fa1c373c6aff65c13791cc11da72060a8d6\jakarta.persistence-api-3.1.0.jar;C:\Users\han16\.gradle\caches\modules-2\files-2.1\jakarta.transaction\jakarta.transaction-api\2.0.1\51a520e3fae406abb84e2e1148e6746ce3f80a1a\jakarta.transaction-api-2.0.1.jar;C:\Users\han16\.gradle\caches\modules-2\files-2.1\org.aspectj\aspectjweaver\1.9.22.1\bca243d0af0db4758fbae45c5f4995cb5dabb612\aspectjweaver-1.9.22.1.jar;C:\Users\han16\.gradle\caches\modules-2\files-2.1\p6spy\p6spy\3.9.1\a393fe91de298097b0242a9f380267e2bb1e1003\p6spy-3.9.1.jar;C:\Users\han16\.gradle\caches\modules-2\files-2.1\org.springframework.data\spring-data-keyvalue\3.4.2\488264fc8e32cd5ec9a0176fa93ad104855222f4\spring-data-keyvalue-3.4.2.jar;C:\Users\han16\.gradle\caches\modules-2\files-2.1\org.springframework\spring-context-support\6.2.2\d0ad90b2a0e80dcfeffe44184b5d0ac0b262ee46\spring-context-support-6.2.2.jar;C:\Users\han16\.gradle\caches\modules-2\files-2.1\org.springframework\spring-oxm\6.2.2\6ba1aa172f0ab30624ed5068b4ad0942b1b32c93\spring-oxm-6.2.2.jar;C:\Users\han16\.gradle\caches\modules-2\files-2.1\io.netty\netty-handler\4.1.117.Final\db14cd99515f8c98a3f2a347718e59f14d85c503\netty-handler-4.1.117.Final.jar;C:\Users\han16\.gradle\caches\modules-2\files-2.1\io.netty\netty-transport\4.1.117.Final\f81d72962bd134d8d8e11b514321134fa5fd0ce6\netty-transport-4.1.117.Final.jar;C:\Users\han16\.gradle\caches\modules-2\files-2.1\io.netty\netty-common\4.1.117.Final\9e074a4382f56b37f3b9ee1fc21d53e7af58ec9d\netty-common-4.1.117.Final.jar;C:\Users\han16\.gradle\caches\modules-2\files-2.1\io.projectreactor\reactor-core\3.7.2\18e669540bcadf4fae1761779a57a991beb013ec\reactor-core-3.7.2.jar;C:\Users\han16\.gradle\caches\modules-2\files-2.1\org.springframework.boot\spring-boot-actuator\3.4.2\73caa22d88cf4d604aa24efea01b0c1a79cb073a\spring-boot-actuator-3.4.2.jar;C:\Users\han16\.gradle\caches\modules-2\files-2.1\io.micrometer\micrometer-core\1.14.3\8962714eb3a6bf97711765fbefe7f6ac28cae96f\micrometer-core-1.14.3.jar;C:\Users\han16\.gradle\caches\modules-2\files-2.1\io.micrometer\micrometer-commons\1.14.3\bf17f05dd6343d36ecc31076197a962cfdf46131\micrometer-commons-1.14.3.jar;C:\Users\han16\.gradle\caches\modules-2\files-2.1\io.sentry\sentry-spring-jakarta\8.3.0\f8083c6f311bc854305c02f0a6de53f246609651\sentry-spring-jakarta-8.3.0.jar;C:\Users\han16\.gradle\caches\modules-2\files-2.1\io.sentry\sentry-reactor\8.3.0\57a60f151979e4dd2dfe0e46f586f1093dd02bca\sentry-reactor-8.3.0.jar;C:\Users\han16\.gradle\caches\modules-2\files-2.1\ch.qos.logback\logback-classic\1.5.16\113979db51dfad6dc895b34460d7b7ff64ffe7d2\logback-classic-1.5.16.jar;C:\Users\han16\.gradle\caches\modules-2\files-2.1\org.apache.logging.log4j\log4j-to-slf4j\2.24.3\da1143e2a2531ee1c2d90baa98eb50a28a39d5a7\log4j-to-slf4j-2.24.3.jar;C:\Users\han16\.gradle\caches\modules-2\files-2.1\org.slf4j\jul-to-slf4j\2.0.16\6d57da3e961daac65bcca0dd3def6cd11e48a24a\jul-to-slf4j-2.0.16.jar;C:\Users\han16\.gradle\caches\modules-2\files-2.1\org.springframework\spring-jcl\6.2.2\1fbbb0b2e85c6eac7c366c5eed5b124785f05ac8\spring-jcl-6.2.2.jar;C:\Users\han16\.gradle\caches\modules-2\files-2.1\org.springframework.security\spring-security-crypto\6.4.2\a4d5bf27ca449200fc39e07de6ae016eb1ad21da\spring-security-crypto-6.4.2.jar;C:\Users\han16\.gradle\caches\modules-2\files-2.1\io.netty\netty-transport-native-unix-common\4.1.117.Final\684f2316ff2b2171babbc17c95ac3bd97f5f091e\netty-transport-native-unix-common-4.1.117.Final.jar;C:\Users\han16\.gradle\caches\modules-2\files-2.1\io.netty\netty-codec\4.1.117.Final\2831d3431ed93d9c0b64b1c0cce2ced4737539aa\netty-codec-4.1.117.Final.jar;C:\Users\han16\.gradle\caches\modules-2\files-2.1\io.netty\netty-resolver\4.1.117.Final\581b37489a03162f473264b65f53d504269a74b0\netty-resolver-4.1.117.Final.jar;C:\Users\han16\.gradle\caches\modules-2\files-2.1\io.netty\netty-buffer\4.1.117.Final\22b4cc28194cb23671274499229e0ef35028fbd\netty-buffer-4.1.117.Final.jar;C:\Users\han16\.gradle\caches\modules-2\files-2.1\org.reactivestreams\reactive-streams\1.0.4\3864a1320d97d7b045f729a326e1e077661f31b7\reactive-streams-1.0.4.jar;C:\Users\han16\.gradle\caches\modules-2\files-2.1\ch.qos.logback\logback-core\1.5.16\4f17700f046900aea2fadf115e2d67fec921f7fd\logback-core-1.5.16.jar;C:\Users\han16\.gradle\caches\modules-2\files-2.1\org.apache.logging.log4j\log4j-api\2.24.3\b02c125db8b6d295adf72ae6e71af5d83bce2370\log4j-api-2.24.3.jar;C:\Users\han16\.gradle\caches\modules-2\files-2.1\io.sentry\sentry-log4j2\8.3.0\45d1266b481cdf1f7c769d4d37b918b9ff47ed86\sentry-log4j2-8.3.0.jar;C:\Users\han16\.gradle\caches\modules-2\files-2.1\io.micrometer\micrometer-registry-prometheus\1.14.3\d09eae0636e2759aafa561c722129b5c86451368\micrometer-registry-prometheus-1.14.3.jar;C:\Users\han16\.gradle\caches\modules-2\files-2.1\io.prometheus\prometheus-metrics-core\1.3.5\2169cfe39084609c72a1fcd1a5775f74a4531919\prometheus-metrics-core-1.3.5.jar;C:\Users\han16\.gradle\caches\modules-2\files-2.1\io.prometheus\prometheus-metrics-tracer-common\1.3.5\adf529b691eb4514124662ad47e67676be52c3d8\prometheus-metrics-tracer-common-1.3.5.jar;C:\Users\han16\.gradle\caches\modules-2\files-2.1\io.prometheus\prometheus-metrics-exposition-formats\1.3.5\3a5d2539dad545b15a60f7113a01734779906d97\prometheus-metrics-exposition-formats-1.3.5.jar;C:\Users\han16\.gradle\caches\modules-2\files-2.1\org.hibernate.common\hibernate-commons-annotations\7.0.3.Final\e183c4be8bb41d12e9f19b374e00c34a0a85f439\hibernate-commons-annotations-7.0.3.Final.jar;C:\Users\han16\.gradle\caches\modules-2\files-2.1\io.smallrye\jandex\3.2.0\f17ad860f62a08487b9edabde608f8ac55c62fa7\jandex-3.2.0.jar;C:\Users\han16\.gradle\caches\modules-2\files-2.1\net.bytebuddy\byte-buddy\1.15.11\f61886478e0f9ee4c21d09574736f0ff45e0a46c\byte-buddy-1.15.11.jar;C:\Users\han16\.gradle\caches\modules-2\files-2.1\org.glassfish.jaxb\jaxb-runtime\4.0.5\ca84c2a7169b5293e232b9d00d1e4e36d4c3914a\jaxb-runtime-4.0.5.jar;C:\Users\han16\.gradle\caches\modules-2\files-2.1\jakarta.xml.bind\jakarta.xml.bind-api\4.0.2\6cd5a999b834b63238005b7144136379dc36cad2\jakarta.xml.bind-api-4.0.2.jar;C:\Users\han16\.gradle\caches\modules-2\files-2.1\jakarta.inject\jakarta.inject-api\2.0.1\4c28afe1991a941d7702fe1362c365f0a8641d1e\jakarta.inject-api-2.0.1.jar;C:\Users\han16\.gradle\caches\modules-2\files-2.1\org.hdrhistogram\HdrHistogram\2.2.2\7959933ebcc0f05b2eaa5af0a0c8689fa257b15c\HdrHistogram-2.2.2.jar;C:\Users\han16\.gradle\caches\modules-2\files-2.1\org.latencyutils\LatencyUtils\2.0.3\769c0b82cb2421c8256300e907298a9410a2a3d3\LatencyUtils-2.0.3.jar;C:\Users\han16\.gradle\caches\modules-2\files-2.1\io.prometheus\prometheus-metrics-model\1.3.5\6a58b494b55eb3c0627cd00ac3957dc660fd4cf\prometheus-metrics-model-1.3.5.jar;C:\Users\han16\.gradle\caches\modules-2\files-2.1\io.prometheus\prometheus-metrics-config\1.3.5\c25f5a3e02c8de54cf4c38b21147ca2994135af6\prometheus-metrics-config-1.3.5.jar;C:\Users\han16\.gradle\caches\modules-2\files-2.1\io.prometheus\prometheus-metrics-exposition-textformats\1.3.5\c23b4fadcc2bb27a32a48f81fb8ac27b3f8cf192\prometheus-metrics-exposition-textformats-1.3.5.jar;C:\Users\han16\.gradle\caches\modules-2\files-2.1\org.glassfish.jaxb\jaxb-core\4.0.5\7b4b11ea5542eea4ad55e1080b23be436795b3\jaxb-core-4.0.5.jar;C:\Users\han16\.gradle\caches\modules-2\files-2.1\jakarta.activation\jakarta.activation-api\2.1.3\fa165bd70cda600368eee31555222776a46b881f\jakarta.activation-api-2.1.3.jar;C:\Users\han16\.gradle\caches\modules-2\files-2.1\org.eclipse.angus\angus-activation\2.0.2\41f1e0ddd157c856926ed149ab837d110955a9fc\angus-activation-2.0.2.jar;C:\Users\han16\.gradle\caches\modules-2\files-2.1\org.glassfish.jaxb\txw2\4.0.5\f36a4ef12120a9bb06d766d6a0e54b144fd7ed98\txw2-4.0.5.jar;C:\Users\han16\.gradle\caches\modules-2\files-2.1\com.sun.istack\istack-commons-runtime\4.1.2\18ec117c85f3ba0ac65409136afa8e42bc74e739\istack-commons-runtime-4.1.2.jar com.gachon.home_protector.HomeProtectorApplication
10:21:22,937 |-INFO in ch.qos.logback.classic.LoggerContext[default] - This is logback-classic version 1.5.16
10:21:22,943 |-INFO in ch.qos.logback.classic.util.ContextInitializer@4a067c25 - Here is a list of configurators discovered as a service, by rank: 
10:21:22,944 |-INFO in ch.qos.logback.classic.util.ContextInitializer@4a067c25 -   org.springframework.boot.logging.logback.RootLogLevelConfigurator
10:21:22,944 |-INFO in ch.qos.logback.classic.util.ContextInitializer@4a067c25 - They will be invoked in order until ExecutionStatus.DO_NOT_INVOKE_NEXT_IF_ANY is returned.
10:21:22,944 |-INFO in ch.qos.logback.classic.util.ContextInitializer@4a067c25 - Constructed configurator of type class org.springframework.boot.logging.logback.RootLogLevelConfigurator
10:21:22,950 |-INFO in ch.qos.logback.classic.util.ContextInitializer@4a067c25 - org.springframework.boot.logging.logback.RootLogLevelConfigurator.configure() call lasted 1 milliseconds. ExecutionStatus=INVOKE_NEXT_IF_ANY
10:21:22,950 |-INFO in ch.qos.logback.classic.util.ContextInitializer@4a067c25 - Trying to configure with ch.qos.logback.classic.joran.SerializedModelConfigurator
10:21:22,952 |-INFO in ch.qos.logback.classic.util.ContextInitializer@4a067c25 - Constructed configurator of type class ch.qos.logback.classic.joran.SerializedModelConfigurator
10:21:22,953 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Could NOT find resource [logback-test.scmo]
10:21:22,953 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Could NOT find resource [logback.scmo]
10:21:22,953 |-INFO in ch.qos.logback.classic.util.ContextInitializer@4a067c25 - ch.qos.logback.classic.joran.SerializedModelConfigurator.configure() call lasted 1 milliseconds. ExecutionStatus=INVOKE_NEXT_IF_ANY
10:21:22,953 |-INFO in ch.qos.logback.classic.util.ContextInitializer@4a067c25 - Trying to configure with ch.qos.logback.classic.util.DefaultJoranConfigurator
10:21:22,954 |-INFO in ch.qos.logback.classic.util.ContextInitializer@4a067c25 - Constructed configurator of type class ch.qos.logback.classic.util.DefaultJoranConfigurator
10:21:22,955 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Could NOT find resource [logback-test.xml]
10:21:22,955 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Could NOT find resource [logback.xml]
10:21:22,955 |-INFO in ch.qos.logback.classic.util.ContextInitializer@4a067c25 - ch.qos.logback.classic.util.DefaultJoranConfigurator.configure() call lasted 1 milliseconds. ExecutionStatus=INVOKE_NEXT_IF_ANY
10:21:22,955 |-INFO in ch.qos.logback.classic.util.ContextInitializer@4a067c25 - Trying to configure with ch.qos.logback.classic.BasicConfigurator
10:21:22,957 |-INFO in ch.qos.logback.classic.util.ContextInitializer@4a067c25 - Constructed configurator of type class ch.qos.logback.classic.BasicConfigurator
10:21:22,957 |-INFO in ch.qos.logback.classic.BasicConfigurator@a1217f9 - Setting up default configuration.
10:21:22,980 |-INFO in ch.qos.logback.core.ConsoleAppender[console] - BEWARE: Writing to the console can be very slow. Avoid logging to the 
10:21:22,980 |-INFO in ch.qos.logback.core.ConsoleAppender[console] - console in production environments, especially in high volume systems.
10:21:22,980 |-INFO in ch.qos.logback.core.ConsoleAppender[console] - See also https://logback.qos.ch/codes.html#slowConsole
10:21:22,980 |-INFO in ch.qos.logback.classic.util.ContextInitializer@4a067c25 - ch.qos.logback.classic.BasicConfigurator.configure() call lasted 23 milliseconds. ExecutionStatus=NEUTRAL
10:21:23,650 |-INFO in ch.qos.logback.core.model.processor.TimestampModelHandler - Using current interpretation time, i.e. now, as time reference.
10:21:23,652 |-INFO in ch.qos.logback.core.model.processor.TimestampModelHandler - Adding property to the context with key="BY_DATE" and value="2025-07-02" to the LOCAL scope
10:21:23,658 |-INFO in ch.qos.logback.core.model.processor.AppenderModelHandler - Processing appender named [CONSOLE]
10:21:23,658 |-INFO in ch.qos.logback.core.model.processor.AppenderModelHandler - About to instantiate appender of type [ch.qos.logback.core.ConsoleAppender]
10:21:23,662 |-INFO in ch.qos.logback.core.model.processor.ImplicitModelHandler - Assuming default type [ch.qos.logback.classic.encoder.PatternLayoutEncoder] for [encoder] property
10:21:23,663 |-INFO in ch.qos.logback.core.model.processor.ModelInterpretationContext@3bde62ff - value "[%d{yyyy-MM-dd HH:mm:ss}:%-4relative] %green([%thread]) %highlight(%-5level) [%X{traceId:-},%X{spanId:-}] %boldWhite([%C.%M:%yellow(%L)]) - %msg%n" substituted for "${LOG_PATTERN}"
10:21:23,694 |-INFO in ch.qos.logback.core.ConsoleAppender[CONSOLE] - BEWARE: Writing to the console can be very slow. Avoid logging to the 
10:21:23,694 |-INFO in ch.qos.logback.core.ConsoleAppender[CONSOLE] - console in production environments, especially in high volume systems.
10:21:23,694 |-INFO in ch.qos.logback.core.ConsoleAppender[CONSOLE] - See also https://logback.qos.ch/codes.html#slowConsole
10:21:23,695 |-WARN in ch.qos.logback.core.model.processor.AppenderModelHandler - Appender named [Sentry] not referenced. Skipping further processing.
10:21:23,695 |-INFO in ch.qos.logback.core.model.processor.AppenderModelHandler - Processing appender named [ERROR_FILE]
10:21:23,695 |-INFO in ch.qos.logback.core.model.processor.AppenderModelHandler - About to instantiate appender of type [ch.qos.logback.core.rolling.RollingFileAppender]
10:21:23,705 |-INFO in c.q.l.core.rolling.TimeBasedRollingPolicy@1379148981 - No compression will be used
10:21:23,706 |-INFO in c.q.l.core.rolling.TimeBasedRollingPolicy@1379148981 - Will use the pattern log/error/error_%d{yyyy-MM-dd}.log for the active file
10:21:23,719 |-INFO in c.q.l.core.rolling.DefaultTimeBasedFileNamingAndTriggeringPolicy - The date pattern is 'yyyy-MM-dd' from file name pattern 'log/error/error_%d{yyyy-MM-dd}.log'.
10:21:23,719 |-INFO in c.q.l.core.rolling.DefaultTimeBasedFileNamingAndTriggeringPolicy - Roll-over at midnight.
10:21:23,722 |-INFO in c.q.l.core.rolling.DefaultTimeBasedFileNamingAndTriggeringPolicy - Setting initial period to 2025-07-02T01:21:23.722Z
10:21:23,723 |-INFO in ch.qos.logback.core.model.processor.ImplicitModelHandler - Assuming default type [ch.qos.logback.classic.encoder.PatternLayoutEncoder] for [encoder] property
10:21:23,724 |-INFO in ch.qos.logback.core.rolling.RollingFileAppender[ERROR_FILE] - Active log file name: log/error/error_2025-07-02.log
10:21:23,724 |-INFO in ch.qos.logback.core.rolling.RollingFileAppender[ERROR_FILE] - File property is set to [null]
10:21:23,725 |-INFO in ch.qos.logback.core.model.processor.AppenderModelHandler - Processing appender named [ACCESS_FILE]
10:21:23,725 |-INFO in ch.qos.logback.core.model.processor.AppenderModelHandler - About to instantiate appender of type [ch.qos.logback.core.rolling.RollingFileAppender]
10:21:23,725 |-INFO in c.q.l.core.rolling.TimeBasedRollingPolicy@732597634 - No compression will be used
10:21:23,725 |-INFO in c.q.l.core.rolling.TimeBasedRollingPolicy@732597634 - Will use the pattern log/warn/warn.%d{yyyy-MM-dd}.log for the active file
10:21:23,725 |-INFO in c.q.l.core.rolling.DefaultTimeBasedFileNamingAndTriggeringPolicy - The date pattern is 'yyyy-MM-dd' from file name pattern 'log/warn/warn.%d{yyyy-MM-dd}.log'.
10:21:23,725 |-INFO in c.q.l.core.rolling.DefaultTimeBasedFileNamingAndTriggeringPolicy - Roll-over at midnight.
10:21:23,726 |-INFO in c.q.l.core.rolling.DefaultTimeBasedFileNamingAndTriggeringPolicy - Setting initial period to 2025-07-02T01:21:23.726Z
10:21:23,726 |-INFO in ch.qos.logback.core.model.processor.ImplicitModelHandler - Assuming default type [ch.qos.logback.classic.encoder.PatternLayoutEncoder] for [encoder] property
10:21:23,726 |-INFO in ch.qos.logback.core.rolling.RollingFileAppender[ACCESS_FILE] - Active log file name: log/warn/warn.2025-07-02.log
10:21:23,726 |-INFO in ch.qos.logback.core.rolling.RollingFileAppender[ACCESS_FILE] - File property is set to [null]
10:21:23,727 |-INFO in ch.qos.logback.core.model.processor.DefaultProcessor@319dead1 - End of configuration.
10:21:23,727 |-INFO in org.springframework.boot.logging.logback.SpringBootJoranConfigurator@791cbf87 - Registering current configuration as safe fallback point


  .   ____          _            __ _ _
 /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
 \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
  '  |____| .__|_| |_|_| |_\__, | / / / /
 =========|_|==============|___/=/_/_/_/

 :: Spring Boot ::                (v3.4.2)

 

 

이 프로젝트에 적용된 spring-logback.xml 내용은 다음과 같다.

 

<configuration>
    <timestamp key="BY_DATE" datePattern="yyyy-MM-dd"/>
    <property name="LOG_PATTERN"
              value="[%d{yyyy-MM-dd HH:mm:ss}:%-4relative] %green([%thread]) %highlight(%-5level) [%X{traceId:-},%X{spanId:-}] %boldWhite([%C.%M:%yellow(%L)]) - %msg%n"/>

    <!--console 에 출력되는 로그 형식 지정-->
    <appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
        <encoder>
            <pattern>${LOG_PATTERN}</pattern>
        </encoder>
    </appender>

    <appender name="Sentry" class="io.sentry.logback.SentryAppender">

        <maxRequestBodySize>always</maxRequestBodySize>
        <sendDefaultPii>true</sendDefaultPii>
        <tracesSampleRate>1.0</tracesSampleRate>
        <minimumEventLevel>ERROR</minimumEventLevel>
        <minimumBreadcrumbLevel>DEBUG</minimumBreadcrumbLevel>

        <encoder>
            <pattern>%d{yyyy-MM-dd HH:mm:ss} [%thread] %-5level %logger{36} - %msg%n</pattern>
        </encoder>
    </appender>

    <!-- ERROR 로그를 error.log에 저장 -->
    <appender name="ERROR_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">

        <!--log level이 error일 경우 ACCEPT, 아니면 DENY, 즉 log.error() 결과물이 기록됨-->
        <filter class="ch.qos.logback.classic.filter.LevelFilter">
            <level>error</level>
            <onMatch>ACCEPT</onMatch>
            <onMismatch>DENY</onMismatch>
        </filter>

        <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
            <fileNamePattern>log/error/error_%d{yyyy-MM-dd}.log</fileNamePattern>
            <maxHistory>7</maxHistory>
        </rollingPolicy>

        <encoder>
            <pattern>%d{yyyy-MM-dd HH:mm:ss} [%thread] %-5level %logger{36} - %msg%n</pattern>
        </encoder>
    </appender>

    <!--WARN 레벨 로그를 warn.log에 저장-->
    <appender name="ACCESS_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
        <filter class="ch.qos.logback.classic.filter.LevelFilter">
            <level>warn</level>
            <onMatch>ACCEPT</onMatch>
            <onMismatch>DENY</onMismatch>
        </filter>

        <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
            <maxHistory>50</maxHistory>
            <fileNamePattern>log/warn/warn.%d{yyyy-MM-dd}.log</fileNamePattern>
        </rollingPolicy>

        <encoder>
            <pattern>%d{yyyy-MM-dd HH:mm:ss} [%thread] %-5level %logger{36} - %msg%n</pattern>
        </encoder>
    </appender>

    <!--WARN 레벨 이상 로그 대해서만 xml 파일 통해 관리-->
    <!--이 통해 STDOUT, ERROR_FILE appender 대해 적용-->

    <springProfile name="local">
        <root level="INFO">
            <appender-ref ref="CONSOLE"/>
        </root>
    </springProfile>

    <springProfile name="dev">
        <root level="INFO">
            <appender-ref ref="CONSOLE"/>
            <appender-ref ref="SENTRY"/>
            <appender-ref ref="ERROR_FILE"/>
            <appender-ref ref="ACCESS_FILE"/>
        </root>
    </springProfile>
</configuration>

 

 

이것저것 시도해보니, dev 내에 있는 SENTRY appener 를 주석 처리하고 재실행하면 제대로 나오는 것을 볼 수 있다!

10:24:49,595 |-INFO in ch.qos.logback.core.model.processor.AppenderRefModelHandler - Attaching appender named [ACCESS_FILE] to Logger[ROOT]
10:24:49,595 |-INFO in ch.qos.logback.core.model.processor.DefaultProcessor@32057e6 - End of configuration.
10:24:49,596 |-INFO in org.springframework.boot.logging.logback.SpringBootJoranConfigurator@26be6ca7 - Registering current configuration as safe fallback point


  .   ____          _            __ _ _
 /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
 \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
  '  |____| .__|_| |_|_| |_\__, | / / / /
 =========|_|==============|___/=/_/_/_/

 :: Spring Boot ::                (v3.4.2)

[2025-07-02 10:24:49:833 ] [background-preinit] INFO  [,] [org.hibernate.validator.internal.util.Version.<clinit>:21] - HV000001: Hibernate Validator 8.0.2.Final
[2025-07-02 10:24:49:898 ] [main] INFO  [,] [org.springframework.boot.StartupInfoLogger.logStarting:53] - Starting HomeProtectorApplication using Java 17.0.12 with PID 7392 (C:\Users\han16\Desktop\home-protector\home-protector\out\production\classes started by han16 in C:\Users\han16\Desktop\home-protector\home-protector)
[2025-07-02 10:24:49:899 ] [main] INFO  [,] [org.springframework.boot.SpringApplication.logStartupProfileInfo:658] - The following 1 profile is active: "dev"
[2025-07-02 10:24:50:2157] [main] INFO  [,] [org.springframework.data.repository.config.RepositoryConfigurationDelegate.multipleStoresDetected:295] - Multiple Spring Data modules found, entering strict repository configuration mode
[2025-07-02 10:24:50:2161] [main] INFO  [,] [org.springframework.data.repository.config.RepositoryConfigurationDelegate.registerRepositoriesIn:143] - Bootstrapping Spring Data JPA repositories in DEFAULT mode.
[2025-07-02 10:24:51:2310] [main] INFO  [,] [org.springframework.data.repository.config.RepositoryConfigurationExtensionSupport.isStrictRepositoryCandidate:327] - Spring Data JPA - Could not safely identify store assignment for repository candidate interface com.gachon.home_protector.domain.token.repository.IdentificationTokenRepository; If you want this repository to be a JPA repository, consider annotating your entities with one of these annotations: jakarta.persistence.Entity, jakarta.persistence.MappedSuperclass (preferred), or consider extending one of the following types with your repository: org.springframework.data.jpa.repository.JpaRepository
[2025-07-02 10:24:51:2312] [main] INFO  [,] [org.springframework.data.repository.config.RepositoryConfigurationExtensionSupport.isStrictRepositoryCandidate:327] - Spring Data JPA - Could not safely identify store assignment for repository candidate interface com.gachon.home_protector.domain.token.repository.RefreshTokenRepository; If you want this repository to be a JPA repository, consider annotating your entities with one of these annotations: jakarta.persistence.Entity, jakarta.persistence.MappedSuperclass (preferred), or consider extending one of the following types with your repository: org.springframework.data.jpa.repository.JpaRepository
[2025-07-02 10:24:51:2335] [main] INFO  [,] [org.springframework.data.repository.config.RepositoryConfigurationDelegate.registerRepositoriesIn:211] - Finished Spring Data repository scanning in 163 ms. Found 3 JPA repository interfaces.
[2025-07-02 10:24:51:2345] [main] INFO  [,] [org.springframework.data.repository.config.RepositoryConfigurationDelegate.multipleStoresDetected:295] - Multiple Spring Data modules found, entering strict repository configuration mode

 

 

이 부분을 중점적으로 확인해보니 <springProfile="dev"> 부분에서 SENTRY 가 아닌 Sentry 라 써서 안 나오는 거엿다 헉... 

 

<configuration>
    <timestamp key="BY_DATE" datePattern="yyyy-MM-dd"/>
    <property name="LOG_PATTERN"
              value="[%d{yyyy-MM-dd HH:mm:ss}:%-4relative] %green([%thread]) %highlight(%-5level) [%X{traceId:-},%X{spanId:-}] %boldWhite([%C.%M:%yellow(%L)]) - %msg%n"/>

    <!--console 에 출력되는 로그 형식 지정-->
    <appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
        <encoder>
            <pattern>${LOG_PATTERN}</pattern>
        </encoder>
    </appender>

    <appender name="SENTRY" class="io.sentry.logback.SentryAppender">

        <maxRequestBodySize>always</maxRequestBodySize>
        <sendDefaultPii>true</sendDefaultPii>
        <tracesSampleRate>1.0</tracesSampleRate>
        <minimumEventLevel>ERROR</minimumEventLevel>
        <minimumBreadcrumbLevel>DEBUG</minimumBreadcrumbLevel>

        <encoder>
            <pattern>%d{yyyy-MM-dd HH:mm:ss} [%thread] %-5level %logger{36} - %msg%n</pattern>
        </encoder>
    </appender>

    <!-- ERROR 로그를 error.log에 저장 -->
    <appender name="ERROR_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">

        <!--log level이 error일 경우 ACCEPT, 아니면 DENY, 즉 log.error() 결과물이 기록됨-->
        <filter class="ch.qos.logback.classic.filter.LevelFilter">
            <level>error</level>
            <onMatch>ACCEPT</onMatch>
            <onMismatch>DENY</onMismatch>
        </filter>

        <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
            <fileNamePattern>log/error/error_%d{yyyy-MM-dd}.log</fileNamePattern>
            <maxHistory>7</maxHistory>
        </rollingPolicy>

        <encoder>
            <pattern>%d{yyyy-MM-dd HH:mm:ss} [%thread] %-5level %logger{36} - %msg%n</pattern>
        </encoder>
    </appender>

    <!--WARN 레벨 로그를 warn.log에 저장-->
    <appender name="ACCESS_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
        <filter class="ch.qos.logback.classic.filter.LevelFilter">
            <level>warn</level>
            <onMatch>ACCEPT</onMatch>
            <onMismatch>DENY</onMismatch>
        </filter>

        <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
            <maxHistory>50</maxHistory>
            <fileNamePattern>log/warn/warn.%d{yyyy-MM-dd}.log</fileNamePattern>
        </rollingPolicy>

        <encoder>
            <pattern>%d{yyyy-MM-dd HH:mm:ss} [%thread] %-5level %logger{36} - %msg%n</pattern>
        </encoder>
    </appender>

    <!--WARN 레벨 이상 로그 대해서만 xml 파일 통해 관리-->
    <!--이 통해 STDOUT, ERROR_FILE appender 대해 적용-->

    <springProfile name="local">
        <root level="INFO">
            <appender-ref ref="CONSOLE"/>
        </root>
    </springProfile>

    <springProfile name="dev">
        <root level="INFO">
            <appender-ref ref="CONSOLE"/>
            <appender-ref ref="SENTRY"/>
            <appender-ref ref="ERROR_FILE"/>
            <appender-ref ref="ACCESS_FILE"/>
        </root>
    </springProfile>
</configuration>

 

이것만 넣긴 좀 그러니... 내가 참여하는 타 프로젝트에서는 Sentry 관련해서 logback 설정을 어떻게 하는 지 살펴보자

 

이 프로젝트에서는 위 프로젝트의 SENTRY 뿐만이 아닌, SLACK/ASYNC_SLACK appender 가 같이 있는데, 이는 혹시 SENTRY 에 장애가 발생하는 경우에도 에러를 캐치할 수 있도록 적용했다. 이렇게 할 경우에는 Sentry 내 Integration 에 따로 Slack, Discord 등 등록하는 것을 자제해야겟다

<!-- ✅ Sentry 설정 (트레이싱 정보 포함) -->
    <appender name="SENTRY" class="io.sentry.logback.SentryAppender">
        <maxRequestBodySize>always</maxRequestBodySize>
        <sendDefaultPii>true</sendDefaultPii>
        <tracesSampleRate>1.0</tracesSampleRate>
        <minimumEventLevel>ERROR</minimumEventLevel>
        <minimumBreadcrumbLevel>DEBUG</minimumBreadcrumbLevel>
    </appender>

    <springProperty name="SENTRY_REPOSITORY_URI" source="sentry.repository-uri"/>
    <springProperty name="NAME" source="spring.application.name"/>
    <springProperty name="ENVIRONMENT" source="sentry.environment"/>
    <springProperty name="SLACK_WEBHOOK_URI" source="slack.webhook-url"/>

    <!-- ✅ Slack 알림에도 트레이스 ID 포함 -->
    <appender name="SLACK" class="com.github.maricn.logback.SlackAppender">
        <webhookUri>${SLACK_WEBHOOK_URI}</webhookUri>
        <layout class="ch.qos.logback.classic.PatternLayout">
            <pattern>*🚨[${ENVIRONMENT}]-[${NAME}] %d{yyyy-MM-dd HH:mm:ss.SSS} %-4relative [%thread] %-5level [%X{traceId:-},%X{spanId:-}] %class - %msg &lt;${SENTRY_REPOSITORY_URI}|Go-To-Sentry&gt;*
                %n
            </pattern>
        </layout>
        <username>Error-Bot</username>
        <iconEmoji>:robot_face:</iconEmoji>
        <colorCoding>true</colorCoding>
    </appender>

    <appender name="ASYNC_SLACK" class="ch.qos.logback.classic.AsyncAppender">
        <appender-ref ref="SLACK"/>
        <filter class="ch.qos.logback.classic.filter.ThresholdFilter">
            <level>ERROR</level>
        </filter>
    </appender>

    <springProfile name="local">
        <root level="INFO">
            <appender-ref ref="CONSOLE"/>
            <!--            <appender-ref ref="SENTRY"/>-->
            <!--            <appender-ref ref="ASYNC_SLACK"/>-->
        </root>
    </springProfile>

    <springProfile name="dev">
        <root level="INFO">
            <appender-ref ref="CONSOLE"/>
            <appender-ref ref="SENTRY"/>
            <appender-ref ref="ASYNC_SLACK"/>
        </root>
    </springProfile>

    <springProfile name="prod">
        <root level="INFO">
            <appender-ref ref="CONSOLE"/>
            <appender-ref ref="SENTRY"/>
            <appender-ref ref="ASYNC_SLACK"/>
        </root>
    </springProfile>