Rolling log Files & removing old log files

前端 未结 6 2008
长发绾君心
长发绾君心 2021-02-07 03:15

I am working on a Java SOAP based webservice application where I am writing stdout to a text file as log for our reference. That file is growing enormously, so I need to check f

6条回答
  •  名媛妹妹
    2021-02-07 03:40

    I use logback to do this. The example below is a time based rolling policy. Depending upon how much data your outputting during your logs, this may work for you as-is.

    Also, as a bonus, my config file tosses the log into HTML to make it easy to view for management types who want to look though the log file.

    Relevant part of the config file:

     
        logs\logFile.html
        
            
         
     
    热议问题