Commit b09a65e0cc6934cd6db597b54aa5c161b0f5dd49
1 parent
c5a8828351
Exists in
master
and in
6 other branches
commit
Showing 3 changed files with 43 additions and 46 deletions
platform-common/src/main/java/com/lyms/platform/common/log4j/DailyRollingFileAppender.java
View file @
b09a65e
| ... | ... | @@ -7,47 +7,46 @@ |
| 7 | 7 | import java.io.IOException; |
| 8 | 8 | |
| 9 | 9 | /** |
| 10 | - * | |
| 11 | 10 | * 解决log4j BufferedIO=true 时,buffer有残余日志不能记录的问题 |
| 12 | - * | |
| 11 | + * <p/> | |
| 13 | 12 | * Created by jiangjiazhi on 2017/5/22. |
| 14 | 13 | */ |
| 15 | -public class DailyRollingFileAppender extends | |
| 16 | - org.apache.log4j.DailyRollingFileAppender { | |
| 17 | - | |
| 18 | - public DailyRollingFileAppender() { | |
| 19 | - super(); | |
| 20 | - Runtime.getRuntime().addShutdownHook(new Log4jHockThread()); | |
| 21 | - } | |
| 22 | - | |
| 23 | - public DailyRollingFileAppender(Layout layout, String filename, | |
| 24 | - String datePattern) throws IOException { | |
| 25 | - super(layout, filename, datePattern); | |
| 26 | - Runtime.getRuntime().addShutdownHook(new Log4jHockThread()); | |
| 27 | - } | |
| 28 | - | |
| 29 | - @Override | |
| 30 | - public synchronized void setFile(String fileName, boolean append, | |
| 31 | - boolean bufferedIO, int bufferSize) throws IOException { | |
| 32 | - File logfile = new File(fileName); | |
| 33 | - | |
| 34 | - logfile.getParentFile().mkdirs(); | |
| 35 | - | |
| 36 | - super.setFile(fileName, append, bufferedIO, bufferSize); | |
| 37 | - } | |
| 38 | - | |
| 39 | - public QuietWriter getQw() { | |
| 40 | - return super.qw; | |
| 41 | - } | |
| 42 | - | |
| 43 | - private class Log4jHockThread extends Thread { | |
| 44 | - @Override | |
| 45 | - public void run() { | |
| 46 | - QuietWriter qw = DailyRollingFileAppender.this.getQw(); | |
| 47 | - if (qw != null) { | |
| 48 | - qw.flush(); | |
| 49 | - } | |
| 50 | - } | |
| 51 | - } | |
| 14 | +public class DailyRollingFileAppender extends | |
| 15 | + org.apache.log4j.DailyRollingFileAppender { | |
| 16 | + | |
| 17 | + public DailyRollingFileAppender() { | |
| 18 | + super(); | |
| 19 | + Runtime.getRuntime().addShutdownHook(new Log4jHockThread()); | |
| 20 | + } | |
| 21 | + | |
| 22 | + public DailyRollingFileAppender(Layout layout, String filename, | |
| 23 | + String datePattern) throws IOException { | |
| 24 | + super(layout, filename, datePattern); | |
| 25 | + Runtime.getRuntime().addShutdownHook(new Log4jHockThread()); | |
| 26 | + } | |
| 27 | + | |
| 28 | + @Override | |
| 29 | + public synchronized void setFile(String fileName, boolean append, | |
| 30 | + boolean bufferedIO, int bufferSize) throws IOException { | |
| 31 | + File logfile = new File(fileName); | |
| 32 | + | |
| 33 | + logfile.getParentFile().mkdirs(); | |
| 34 | + | |
| 35 | + super.setFile(fileName, append, bufferedIO, bufferSize); | |
| 36 | + } | |
| 37 | + | |
| 38 | + public QuietWriter getQw() { | |
| 39 | + return super.qw; | |
| 40 | + } | |
| 41 | + | |
| 42 | + private class Log4jHockThread extends Thread { | |
| 43 | + @Override | |
| 44 | + public void run() { | |
| 45 | + QuietWriter qw = DailyRollingFileAppender.this.getQw(); | |
| 46 | + if (qw != null) { | |
| 47 | + qw.flush(); | |
| 48 | + } | |
| 52 | 49 | } |
| 50 | + } | |
| 51 | +} |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/BabyEarController.java
View file @
b09a65e
| ... | ... | @@ -2,7 +2,6 @@ |
| 2 | 2 | |
| 3 | 3 | import com.lyms.platform.common.annotation.TokenRequired; |
| 4 | 4 | import com.lyms.platform.common.base.BaseController; |
| 5 | -import com.lyms.platform.common.base.ContextHolder; | |
| 6 | 5 | import com.lyms.platform.common.base.LoginContext; |
| 7 | 6 | import com.lyms.platform.common.result.BaseResponse; |
| 8 | 7 | import com.lyms.platform.operate.web.facade.BabyEarFacade; |
| 9 | 8 | |
| ... | ... | @@ -11,9 +10,11 @@ |
| 11 | 10 | import org.slf4j.Logger; |
| 12 | 11 | import org.slf4j.LoggerFactory; |
| 13 | 12 | import org.springframework.beans.factory.annotation.Autowired; |
| 14 | -import org.springframework.http.HttpMethod; | |
| 15 | 13 | import org.springframework.stereotype.Controller; |
| 16 | -import org.springframework.web.bind.annotation.*; | |
| 14 | +import org.springframework.web.bind.annotation.RequestMapping; | |
| 15 | +import org.springframework.web.bind.annotation.RequestMethod; | |
| 16 | +import org.springframework.web.bind.annotation.RequestParam; | |
| 17 | +import org.springframework.web.bind.annotation.ResponseBody; | |
| 17 | 18 | |
| 18 | 19 | import javax.servlet.http.HttpServletRequest; |
| 19 | 20 | import javax.validation.Valid; |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BabyEarFacade.java
View file @
b09a65e
| ... | ... | @@ -11,19 +11,16 @@ |
| 11 | 11 | import com.lyms.platform.common.result.BaseObjectResponse; |
| 12 | 12 | import com.lyms.platform.common.result.BaseResponse; |
| 13 | 13 | import com.lyms.platform.common.result.RespBuilder; |
| 14 | -import com.lyms.platform.common.result.ResponseCode; | |
| 15 | 14 | import com.lyms.platform.common.utils.DateUtil; |
| 16 | 15 | import com.lyms.platform.operate.web.request.BabyEarAddRequest; |
| 17 | 16 | import com.lyms.platform.operate.web.request.BabyEarBase; |
| 18 | 17 | import com.lyms.platform.operate.web.request.BabyScreenAddRequest; |
| 19 | 18 | import com.lyms.platform.operate.web.result.BabyEarResult; |
| 20 | -import com.lyms.platform.operate.web.utils.ResponseUtil; | |
| 21 | 19 | import com.lyms.platform.permission.model.*; |
| 22 | 20 | import com.lyms.platform.permission.service.*; |
| 23 | 21 | import com.lyms.platform.pojo.BabyModel; |
| 24 | 22 | import com.lyms.platform.pojo.PersonModel; |
| 25 | 23 | import com.lyms.platform.query.PersonModelQuery; |
| 26 | -import com.sun.xml.internal.rngom.parse.host.Base; | |
| 27 | 24 | import org.apache.commons.collections.CollectionUtils; |
| 28 | 25 | import org.apache.commons.lang.StringUtils; |
| 29 | 26 | import org.slf4j.Logger; |