Skip to content

Commit

Permalink
模块重新命名下
Browse files Browse the repository at this point in the history
  • Loading branch information
dongchenxu committed Jan 31, 2019
1 parent ecb8a5c commit 03ebfc6
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
*/
@MetaInfServices(Module.class)
@Information(id = "debug-exception-logger", version = "0.0.2", author = "luanjia@taobao.com")
public class ExceptionLoggerModule implements Module, LoadCompleted {
public class LogExceptionModule implements Module, LoadCompleted {

private final Logger exLogger = LoggerFactory.getLogger("DEBUG-EXCEPTION-LOGGER");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@
* @author luanjia@taobao.com
*/
@MetaInfServices(Module.class)
@Information(id = "debug-http-logger", version = "0.0.2", author = "luanjia@taobao.com")
public class HttpAccessLoggerModule implements Module, LoadCompleted {
@Information(id = "debug-servlet-access", version = "0.0.2", author = "luanjia@taobao.com")
public class LogServletAccessModule implements Module, LoadCompleted {

private final Logger stLogger = LoggerFactory.getLogger("DEBUG-SERVLET-LOGGER");
private final Logger logger = LoggerFactory.getLogger("DEBUG-SERVLET-ACCESS");

@Resource
private ModuleEventWatcher moduleEventWatcher;
Expand Down Expand Up @@ -213,7 +213,7 @@ private static String formatParameterMap(final Map<String, String[]> parameterMa
private void logAccess(final HttpAccess ha,
final long costMs,
final Throwable cause) {
stLogger.info("{};{};{};{}ms;{};[{}];{};",
logger.info("{};{};{};{}ms;{};[{}];{};",
ha.from,
ha.status,
ha.method,
Expand Down
22 changes: 19 additions & 3 deletions sandbox-debug-module/src/main/resources/logback.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
<configuration scan="true" scanPeriod="10000">

<!-- DEBUG模块:Servlet监控日志 -->
<logger name="DEBUG-SERVLET-LOGGER" level="INFO">
<logger name="DEBUG-SERVLET-ACCESS" level="INFO">
<appender class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${user.home}/logs/sandbox/debug/servlet-monitor.log</file>
<file>${user.home}/logs/sandbox/debug/servlet-access.log</file>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<FileNamePattern>${user.home}/logs/sandbox/debug/servlet-monitor.log.%d{yyyy-MM-dd}</FileNamePattern>
<FileNamePattern>${user.home}/logs/sandbox/debug/servlet-access.log.%d{yyyy-MM-dd}</FileNamePattern>
<MaxHistory>30</MaxHistory>
</rollingPolicy>
<encoder>
Expand All @@ -16,6 +16,22 @@
</appender>
</logger>

<!-- DEBUG模块:Servlet输出日志
<logger name="DEBUG-SERVLET-PRINTER" level="INFO">
<appender class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${user.home}/logs/sandbox/debug/servlet-printer.log</file>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<FileNamePattern>${user.home}/logs/sandbox/debug/servlet-printer.log.%d{yyyy-MM-dd}</FileNamePattern>
<MaxHistory>30</MaxHistory>
</rollingPolicy>
<encoder>
<pattern>%d{yyyy-MM-dd HH:mm:ss} %-5level %msg%n</pattern>
<charset>UTF-8</charset>
</encoder>
</appender>
</logger>
-->

<!-- DEBUG模块:Exception监控日志 -->
<logger name="DEBUG-EXCEPTION-LOGGER" level="INFO">
<appender class="ch.qos.logback.core.rolling.RollingFileAppender">
Expand Down

0 comments on commit 03ebfc6

Please sign in to comment.