How to prevent log bombing using logback?

前端 未结 3 1920
误落风尘
误落风尘 2021-02-09 12:00

I\'m not sure the term \"bombing\" is the right one. By bombing, I mean a log happening many times with the same content (message and args).

For example, a denial of ser

3条回答
  •  感情败类
    2021-02-09 12:51

    The DuplicateMessageFilter, which filters out exact duplicate messages, might fit your first requirement. Currently, the filter stops all duplicate messages after a specified threshold (via allowedRepititions setting), which might not be desirable. You would have to extend the filter if you preferred to have the duplicate-count to reset on new messages or based on time. It does not provide a summary of silenced logs, however.

    Example logback config:

    
    
      
    
      
        
          %date [%thread] %-5level %logger - %msg%n
        
      
    
      
        
        
    
    

提交回复
热议问题