File tree Expand file tree Collapse file tree 3 files changed +33
-0
lines changed Expand file tree Collapse file tree 3 files changed +33
-0
lines changed Original file line number Diff line number Diff line change @@ -39,6 +39,7 @@ dependencies {
3939    implementation ' com.amazonaws:aws-java-sdk-s3:1.12.122' 
4040    implementation ' ch.qos.logback:logback-classic:1.2.8' 
4141    implementation ' ch.qos.logback:logback-core:1.2.8' 
42+     implementation ' com.github.maricn:logback-slack-appender:1.4.0' 
4243    compileOnly ' org.projectlombok:lombok' 
4344    runtimeOnly ' com.h2database:h2' 
4445    runtimeOnly ' mysql:mysql-connector-java' 
Original file line number Diff line number Diff line change @@ -12,6 +12,9 @@ spring:
1212      use-new-id-generator-mappings : false 
1313    properties :
1414      hibernate.dialect : org.hibernate.dialect.MySQL8Dialect 
15+   profiles :
16+     include :
17+       - slack-logging 
1518server :
1619  port : 8080 
1720jwt :
3033      static : ap-northeast-2 
3134    stack :
3235      auto : false 
36+ logging :
37+   slack :
38+     webhook-uri : https://hooks.slack.com/services/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   #  SLACK_WEBHOOK_URI 추가
39+   config : classpath:logback-slack.xml 
Original file line number Diff line number Diff line change 1+ <?xml  version =" 1.0"  encoding =" UTF-8"   ?>
2+ <configuration >
3+     <springProperty  name =" SLACK_WEBHOOK_URI"   source =" logging.slack.webhook-uri"  />
4+     <appender  name =" SLACK"   class =" com.github.maricn.logback.SlackAppender"  >
5+         <webhookUri >${SLACK_WEBHOOK_URI}</webhookUri >
6+         <layout  class =" ch.qos.logback.classic.PatternLayout"  >
7+             <pattern >%-4relative [%thread] %-5level %class - %msg%n</pattern >
8+         </layout >
9+         <username >posting bot</username >
10+         <iconEmoji >:stuck_out_tongue_winking_eye:</iconEmoji >
11+         <colorCoding >true</colorCoding >
12+     </appender >
13+     <appender  name =" ASYNC_SLACK"   class =" ch.qos.logback.classic.AsyncAppender"  >
14+         <appender-ref  ref =" SLACK"  />
15+         <filter  class =" ch.qos.logback.classic.filter.ThresholdFilter"  >
16+             <level >ERROR</level >
17+         </filter >
18+     </appender >
19+ 
20+     <root >
21+         <springProfile  name =" slack-logging"  >
22+             <appender-ref  ref =" ASYNC_SLACK"  />
23+         </springProfile >
24+     </root >
25+ </configuration >
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments