1.項目中使用Log4j對其日誌進行配置管理,採起的方式一種是經過properties文件設置,另外一種方式就是經過設置xml文件的配置。java
使用場景:mysql
編程模型:log.err();log.debug();and so onweb
物理存儲:一個項目天天定時產生一個日誌文件spring
一個項目天天定時產生多個日誌文件,日誌文件針對特殊的業務類(能夠明確監控到一個具體的類上面,有些場景可能對特殊的類須要單獨創建日誌文件)sql
2.maven的使用場景:apache
使用場景:編程
1.項目裏面的jar的管理,所有基於pom文件進行管理,不用手工拷貝jar文件,僅僅拷貝pom文件便可。cookie
2.搭建公司本身的maven的jar倉庫,按期更新便可。mybatis
3.利用maven的profile特性,配置參數,其餘的配置文件好比spring配置文件,能夠使用${}的方式引用profile文件裏面的屬性,配置多個profile參數環境,好比mvc
production、bete、development等,打包時候選擇具體的profile環境便可。
4.項目的多模塊拆分,方便管理。
3.Git的使用場景:
使用場景:
1.項目多人協做,相似SVN的功能
2.與SVN不一樣的是,本地有一套本地倉庫,能夠commit,compare,show history等(與開發人員比較有好處)
3.分支管理與合併合理(此處對於項目經理能夠仔細研究)
4.服務端的圖形界面,能夠明確的看出軟件工程師的代碼貢獻率
======================================================
<Configuration status="INFO">
<Appenders>
<Console name="STDOUT" target="SYSTEM_OUT">
<PatternLayout pattern="[%-5p %d{yyyy-MM-dd HH:mm:ss,SSS}] %m%n"/>
</Console>
<RollingFile name="LOG-MAIN" fileName="${logpath}/main.log"
filePattern="${logpath}/main-%d{yyyy-MM-dd}.log">
<PatternLayout
pattern="[%-5p %d{yyyy-MM-dd HH:mm:ss,SSS}] %m%n"/>
<Policies>
<TimeBasedTriggeringPolicy interval="1" modulate="true" />
</Policies>
<ThresholdFilter level="INFO"/>
</RollingFile>
<RollingFile name="LOG-DNHANDLER" fileName="${logpath}/dnHandler.log"
filePattern="${logpath}/server-%d{yyyy-MM-dd}.log">
<PatternLayout
pattern="[%-5p %d{yyyy-MM-dd HH:mm:ss,SSS}] %m%n"/>
<Policies>
<TimeBasedTriggeringPolicy interval="1" modulate="true" />
</Policies>
<ThresholdFilter level="INFO"/>
</RollingFile>
<RollingFile name="LOG-CIDR4DNSLOADER" fileName="${logpath}/cidr4DNSLoader.log"
filePattern="${logpath}/server-%d{yyyy-MM-dd}.log">
<PatternLayout
pattern="[%-5p %d{yyyy-MM-dd HH:mm:ss,SSS}] %m%n"/>
<Policies>
<TimeBasedTriggeringPolicy interval="1" modulate="true" />
</Policies>
<ThresholdFilter level="INFO"/>
</RollingFile>
<RollingFile name="LOG-DNSERVICEIMPL" fileName="${logpath}/dnServiceImpl.log"
filePattern="${logpath}/server-%d{yyyy-MM-dd}.log">
<PatternLayout
pattern="[%-5p %d{yyyy-MM-dd HH:mm:ss,SSS}] %m%n"/>
<Policies>
<TimeBasedTriggeringPolicy interval="1" modulate="true" />
</Policies>
<ThresholdFilter level="INFO"/>
</RollingFile>
</Appenders>
<Loggers>
<Root level="${loglevel}">
<AppenderRef ref="STDOUT"/>
<AppenderRef ref="LOG-MAIN"/>
</Root>
<logger name="com.bat.app.pat.httpdns.handler.DnHandler" level="${loglevel}" additivity="false">
<AppenderRef ref="LOG-DNHANDLER"/>
</logger>
<logger name="com.bat.app.pat.httpdns.data.Cidr4DNSLoader" level="${loglevel}" additivity="false">
<AppenderRef ref="LOG-CIDR4DNSLOADER"/>
</logger>
<logger name="com.bat.app.pat.httpdns.service.imp.DnServiceImpl" level="${loglevel}" additivity="false">
<AppenderRef ref="LOG-DNSERVICEIMPL"/>
</logger>
</Loggers>
</Configuration>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.bat.app.server</groupId>
<artifactId>xvde</artifactId>
<packaging>war</packaging>
<version>0.0.1-SNAPSHOT</version>
<name>xvde Maven Webapp</name>
<url>http://maven.apache.org</url>
<properties>
<org.springframework.version>3.2.8.RELEASE</org.springframework.version>
</properties>
<dependencies>
<dependency>
<groupId>commons-collections</groupId>
<artifactId>commons-collections</artifactId>
<version>3.2.1</version>
</dependency>
<dependency>
<groupId>commons-lang</groupId>
<artifactId>commons-lang</artifactId>
<version>2.6</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.1.4</version>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.0.8</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>commons-dbcp</groupId>
<artifactId>commons-dbcp</artifactId>
<version>1.4</version>
</dependency>
<dependency>
<groupId>com.bat.ump</groupId>
<artifactId>profiler</artifactId>
<version>3.2.0</version>
</dependency>
<dependency>
<groupId>com.bat</groupId>
<artifactId>erp-sso</artifactId>
<version>1.0.5</version>
<exclusions>
<exclusion>
<artifactId>bat-common-struts</artifactId>
<groupId>com.bat.common</groupId>
</exclusion>
<exclusion>
<groupId>org.aspectj</groupId>
<artifactId>aspectjrt</artifactId>
</exclusion>
<exclusion>
<groupId>cglib</groupId>
<artifactId>cglib</artifactId>
</exclusion>
<exclusion>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
</exclusion>
<exclusion>
<artifactId>spring-batbc</artifactId>
<groupId>org.springframework</groupId>
</exclusion>
<exclusion>
<artifactId>spring-beans</artifactId>
<groupId>org.springframework</groupId>
</exclusion>
<exclusion>
<artifactId>spring-tx</artifactId>
<groupId>org.springframework</groupId>
</exclusion>
<exclusion>
<artifactId>spring-web</artifactId>
<groupId>org.springframework</groupId>
</exclusion>
<exclusion>
<artifactId>spring-core</artifactId>
<groupId>org.springframework</groupId>
</exclusion>
<exclusion>
<artifactId>spring-aop</artifactId>
<groupId>org.springframework</groupId>
</exclusion>
<exclusion>
<artifactId>spring-test</artifactId>
<groupId>org.springframework</groupId>
</exclusion>
<exclusion>
<artifactId>spring-context</artifactId>
<groupId>org.springframework</groupId>
</exclusion>
<exclusion>
<artifactId>spring-webmvc</artifactId>
<groupId>org.springframework</groupId>
</exclusion>
<exclusion>
<artifactId>commons-httpclient</artifactId>
<groupId>commons-httpclient</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.mybatis</groupId>
<artifactId>mybatis-spring</artifactId>
<version>1.2.0</version>
</dependency>
<dependency>
<groupId>org.mybatis</groupId>
<artifactId>mybatis</artifactId>
<version>3.2.6</version>
</dependency>
<dependency>
<groupId>com.bat.ump</groupId>
<artifactId>jannotation</artifactId>
<version>2.1.0</version>
</dependency>
</dependencies>
<build>
<finalName>xvde</finalName>
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
</resource>
</resources>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.5.1</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
<encoding>UTF-8</encoding>
</configuration>
</plugin>
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>2.4</version>
<configuration>
<encoding>UTF-8</encoding>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.4</version>
<configuration>
<archiveClasses>false</archiveClasses>
</configuration>
</plugin>
</plugins>
</build>
<profiles>
<profile>
<id>development</id>
<properties>
<xvde.hrm.cookieKey>18B6697222B1A0925D40FAA00B353F2DF4359D2099</xvde.hrm.cookieKey>
<xvde.hrm.cookieName>erp1.bat.com</xvde.hrm.cookieName>
<jimUrl>xx://1803528818953446384/1</jimUrl>
<log.path>d:/Logs/xvde.m.bat.com</log.path>
<log.level>INFO</log.level>
<xvde.isDev>true</xvde.isDev>
<xvde.batbc.driver>com.mysql.batbc.Driver</xvde.batbc.driver>
<xvde.batbc.url>batbc:mysql://122.168.124.65:3306/xvde?autoReconnect=true</xvde.batbc.url>
<xvde.batbc.username>root</xvde.batbc.username>
<xvde.batbc.password>root@dev</xvde.batbc.password>
<webapp.domain.name>tempxvde.m.bat.com</webapp.domain.name>
<webapp.hrm.login.auth.key>8B6697227CBCA902B1A0925D40FAA00B353F2DF4359D2099</webapp.hrm.login.auth.key>
</properties>
</profile>
<profile>
<id>test</id>
<properties>
<xvde.hrm.cookieKey>8B6697227CBCA902B1A0A00B353F2DF4359D2099</xvde.hrm.cookieKey>
<xvde.hrm.cookieName>erp1.bat.com</xvde.hrm.cookieName>
<jimUrl>xxx://1803528818953446384/1</jimUrl>
<log.path>/export/Logs/xvde.m.bat.com</log.path>
<log.level>INFO</log.level>
<xvde.isDev>true</xvde.isDev>
<xvde.batbc.driver>com.mysql.batbc.Driver</xvde.batbc.driver>
<xvde.batbc.url>batbc:mysql://192.168.11144.65:3306/xvde?autoReconnect=true</xvde.batbc.url>
<xvde.batbc.username>xvde</xvde.batbc.username>
<xvde.batbc.password>123456</xvde.batbc.password>
<webapp.domain.name>tempxvde.m.bat.com</webapp.domain.name>
<webapp.hrm.login.auth.key>8B6697227CBCA902B1A0925D40FAA00B353F2DF4359D2099</webapp.hrm.login.auth.key>
</properties>
</profile>
<profile>
<id>beta</id>
<properties>
<xvde.hrm.cookieKey>C602924B0D1090D931E3771FE1810</xvde.hrm.cookieKey>
<xvde.hrm.cookieName>erp1.bat.com</xvde.hrm.cookieName>
<jimUrl>xx://2876103252179/379</jimUrl>
<log.path>/export/Logs/xvde.m.bat.com</log.path>
<log.level>ERROR</log.level>
<xvde.isDev>false</xvde.isDev>
<xvde.batbc.driver>com.mysql.batbc.Driver</xvde.batbc.driver>
<xvde.batbc.url>batbc:mysql://1amombabym.mysql.batdb.com:3358/xvde?autoReconnect=true</xvde.batbc.url>
<xvde.batbc.username>xvde_rw</xvde.batbc.username>
<xvde.batbc.password>LtwuR_p64j2ibcfOsN8zETWomKC3Yyq</xvde.batbc.password>
<webapp.domain.name>xvde.m.bat.com</webapp.domain.name
</properties>
</profile>
<profile>
<id>production</id>
<properties>
<xvde.hrm.cookieKey>C602924B0D1090D931E3771D74ABBF9733A8C3545CFE1810</xvde.hrm.cookieKey>
<xvde.hrm.cookieName>erp1.bat.com</xvde.hrm.cookieName>
<jimUrl>xxx://2876103256754832179/379</jimUrl>
<log.path>/export/Logs/xvde.m.bat.com</log.path>
<log.level>ERROR</log.level>
<xvde.isDev>false</xvde.isDev>
<xvde.batbc.driver>com.mysql.batbc.Driver</xvde.batbc.driver>
<xvde.batbc.url>batbc:mysql://amombabym.mysql.batdb.com:3358/xvde?autoReconnect=true</xvde.batbc.url>
<xvde.batbc.username>xvde_rw</xvde.batbc.username>
<webapp.domain.name>xvde.m.bat.com</webapp.domain.name>
</properties>
</profile>
</profiles>
</project>
================================================================
log4j
<Configuration status="INFO"> <Appenders> <Console name="STDOUT" target="SYSTEM_OUT"> <PatternLayout pattern="[%-5p %d{yyyy-MM-dd HH:mm:ss,SSS}] %m%n"/> </Console> <RollingFile name="LOG-MAIN" fileName="${logpath}/main.log" filePattern="${logpath}/main-%d{yyyy-MM-dd}.log"> <PatternLayout pattern="[%-5p %d{yyyy-MM-dd HH:mm:ss,SSS}] %m%n"/> <Policies> <TimeBasedTriggeringPolicy interval="1" modulate="true" /> </Policies> <ThresholdFilter level="INFO"/> </RollingFile> <RollingFile name="LOG-DNHANDLER" fileName="${logpath}/dnHandler.log" filePattern="${logpath}/server-%d{yyyy-MM-dd}.log"> <PatternLayout pattern="[%-5p %d{yyyy-MM-dd HH:mm:ss,SSS}] %m%n"/> <Policies> <TimeBasedTriggeringPolicy interval="1" modulate="true" /> </Policies> <ThresholdFilter level="INFO"/> </RollingFile> <RollingFile name="LOG-CIDLOADER" fileName="${logpath}/cidSLoader.log" filePattern="${logpath}/server-%d{yyyy-MM-dd}.log"> <PatternLayout pattern="[%-5p %d{yyyy-MM-dd HH:mm:ss,SSS}] %m%n"/> <Policies> <TimeBasedTriggeringPolicy interval="1" modulate="true" /> </Policies> <ThresholdFilter level="INFO"/> </RollingFile> <RollingFile name="LOG-DNSERVICEIMPL" fileName="${logpath}/dnServiceImpl.log" filePattern="${logpath}/server-%d{yyyy-MM-dd}.log"> <PatternLayout pattern="[%-5p %d{yyyy-MM-dd HH:mm:ss,SSS}] %m%n"/> <Policies> <TimeBasedTriggeringPolicy interval="1" modulate="true" /> </Policies> <ThresholdFilter level="INFO"/> </RollingFile> </Appenders> <Loggers> <Root level="${loglevel}"> <AppenderRef ref="STDOUT"/> <AppenderRef ref="LOG-MAIN"/> </Root> <logger name="com.bat.app.pat.httpdns.handler.DnHandler" level="${loglevel}" additivity="false"> <AppenderRef ref="LOG-DNHANDLER"/> </logger> <logger name="com.bat.app.pat.httpdns.data.CidSLoader" level="${loglevel}" additivity="false"> <AppenderRef ref="LOG-CIDR4DNSLOADER"/> </logger> <logger name="com.bat.app.pat.httpdns.service.imp.DnServiceImpl" level="${loglevel}" additivity="false"> <AppenderRef ref="LOG-DNSERVICEIMPL"/> </logger> </Loggers></Configuration>