Authored by jack.lee

no message

@@ -7,7 +7,6 @@ @@ -7,7 +7,6 @@
7 <property name="yoho.env.servertype" defaultValue="jboss" description="应用服务器类型(jboss or tomcat)"/> 7 <property name="yoho.env.servertype" defaultValue="jboss" description="应用服务器类型(jboss or tomcat)"/>
8 <property name="yoho.env.serverhome" defaultValue="/usr/local/jboss" description="应用服务器(jboss or tomcat)安装路径"/> 8 <property name="yoho.env.serverhome" defaultValue="/usr/local/jboss" description="应用服务器(jboss or tomcat)安装路径"/>
9 <property name="petstore.env.serverport" defaultValue="0" description="应用端口"/> 9 <property name="petstore.env.serverport" defaultValue="0" description="应用端口"/>
10 - <property name="petstore.env.webapphome" defaultValue="/home/login/petstore" description="应用根目录"/>  
11 <property name="petstore.env.namespace" defaultValue="petstore" description="应用命名空间"/> 10 <property name="petstore.env.namespace" defaultValue="petstore" description="应用命名空间"/>
12 <property name="petstore.env.productmode" defaultValue="PRODUCT" description="PRODUCT-生产环境 / TEST-测试环境 / DEV-开发环境"/> 11 <property name="petstore.env.productmode" defaultValue="PRODUCT" description="PRODUCT-生产环境 / TEST-测试环境 / DEV-开发环境"/>
13 </group> 12 </group>
@@ -68,6 +68,24 @@ @@ -68,6 +68,24 @@
68 68
69 <build> 69 <build>
70 <plugins> 70 <plugins>
  71 + <plugin>
  72 + <groupId>com.yoho.tools</groupId>
  73 + <artifactId>maven-autoconfig-plugin</artifactId>
  74 + <version>1.0.0-SNAPSHOT</version>
  75 + <configuration>
  76 + <exploding>false</exploding>
  77 + <dest>${basedir}/src/main</dest>
  78 + <type>Directory</type>
  79 + </configuration>
  80 + <executions>
  81 + <execution>
  82 + <phase>package</phase>
  83 + <goals>
  84 + <goal>autoconfig</goal>
  85 + </goals>
  86 + </execution>
  87 + </executions>
  88 + </plugin>
71 <plugin> 89 <plugin>
72 <groupId>org.mortbay.jetty</groupId> 90 <groupId>org.mortbay.jetty</groupId>
73 <artifactId>maven-jetty-plugin</artifactId> 91 <artifactId>maven-jetty-plugin</artifactId>
  1 +<?xml version="1.0" encoding="UTF-8"?>
  2 +
  3 +<config>
  4 + <group>
  5 + <property name="petstore.env.webapphome" defaultValue="/home/login/petstore/deploy" description="应用根目录"/>
  6 + <property name="petstore.log.level" defaultValue="INFO" description="log级别"/>
  7 + <property name="petstore.log.root" defaultValue="${petstore.env.webapphome}/logs" description="log根目录"/>
  8 + </group>
  9 + <script>
  10 + <generate template="META-INF/autoconf/logback.xml" destfile="WEB-INF/classes/logback.xml"/>
  11 + </script>
  12 +</config>
  1 +<configuration>
  2 + <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
  3 + <filter class="ch.qos.logback.core.filter.EvaluatorFilter">
  4 + <evaluator> <!-- defaults to type ch.qos.logback.classic.boolex.JaninoEventEvaluator -->
  5 + <expression>logger.contains("springframework")</expression>
  6 + </evaluator>
  7 + <OnMismatch>NEUTRAL</OnMismatch>
  8 + <OnMatch>DENY</OnMatch>
  9 + </filter>
  10 +
  11 + <encoder charset="UTF-8">
  12 + <pattern>%-4r - %d{HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n </pattern>
  13 + </encoder>
  14 + </appender>
  15 +
  16 + <appender name="PETSTORE-ALL" class="ch.qos.logback.core.rolling.RollingFileAppender">
  17 + <file>${petstore.log.root}/petstore-all.log</file>
  18 + <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
  19 + <fileNamePattern>petstore-all.%d{yyyy-MM-dd}.log.zip</fileNamePattern>
  20 + </rollingPolicy>
  21 + <encoder>
  22 + <pattern>%-1relative - %d{HH:mm:ss.SSS} [%thread] %-5level %logger{0} -- %msg%n</pattern>
  23 + </encoder>
  24 + </appender>
  25 +
  26 + <appender name="PETSTORE-TIMEOUT-SQL" class="ch.qos.logback.core.rolling.RollingFileAppender">
  27 + <file>${petstore.log.root}/petstore-timeout-sql.log</file>
  28 + <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
  29 + <fileNamePattern>petstore-timeout-sql.%d{yyyy-MM-dd}.log.zip</fileNamePattern>
  30 + </rollingPolicy>
  31 + <encoder>
  32 + <pattern>%-1relative - %d{HH:mm:ss.SSS} [%thread] %-5level %logger{0} -- %msg%n</pattern>
  33 + </encoder>
  34 + </appender>
  35 +
  36 + <appender name="PETSTORE-TIMEOUT-REQUEST" class="ch.qos.logback.core.rolling.RollingFileAppender">
  37 + <file>${petstore.log.root}/petstore-timeout-request.log</file>
  38 + <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
  39 + <fileNamePattern>petstore-timeout-request.%d{yyyy-MM-dd}.log.zip</fileNamePattern>
  40 + </rollingPolicy>
  41 +
  42 + <triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">
  43 + <maxFileSize>5MB</maxFileSize>
  44 + </triggeringPolicy>
  45 +
  46 + <encoder>
  47 + <pattern>%-1relative - %d{HH:mm:ss.SSS} [%thread] %-5level %logger{0} -- %msg%n</pattern>
  48 + </encoder>
  49 + </appender>
  50 +
  51 + <!-- ===================================================================== -->
  52 + <!-- 以下是logger的定义 -->
  53 + <!-- ===================================================================== -->
  54 + <logger name="com.taobao.sample.petstore.dal.dao.ibatis.IbatisGenericDaoImpl" additivity="true">
  55 + <level value="DEBUG"/>
  56 + <appender-ref ref="PETSTORE-TIMEOUT-SQL"/>
  57 + </logger>
  58 +
  59 + <logger name="com.milanoo.zeus.web.filter.timer.TimerFilter" additivity="true">
  60 + <level value="WARN"/>
  61 + <appender-ref ref="PETSTORE-TIMEOUT-REQUEST"/>
  62 + </logger>
  63 +
  64 + <!-- ===================================================================== -->
  65 + <!-- Root logger的定义 -->
  66 + <!-- ===================================================================== -->
  67 + <root level="${petstore.log.level}">
  68 + <appender-ref ref="STDOUT" />
  69 + <appender-ref ref="PETSTORE-ALL" />
  70 + </root>
  71 +</configuration>