• 极客专栏正式上线!欢迎访问 https://www.jikewenku.com/topic.html
  • 极客专栏正式上线!欢迎访问 https://www.jikewenku.com/topic.html

从零到企业级SSM电商项目实战教程(十七)logback和ftp服务器配置

项目实战 Geekerstar 10个月前 (06-21) 447次浏览 已收录 0个评论 扫描二维码
文章目录[隐藏]

logback配置

<?xml version="1.0" encoding="UTF-8"?>
<configuration scan="true" scanPeriod="60 seconds" debug="false">
    <appender name="console" class="ch.qos.logback.core.ConsoleAppender">
        <encoding>UTF-8</encoding>
        <encoder>
            <pattern>[%d{HH:mm:ss.SSS}][%p][%c{40}][%t] %m%n</pattern>
        </encoder>
        <filter class="ch.qos.logback.classic.filter.ThresholdFilter">
            <level>DEBUG</level>
        </filter>
    </appender>

    <appender name="mmall" class="ch.qos.logback.core.rolling.RollingFileAppender">
        <!--<File>d:/mmalllog/mmall.log</File>-->
        <File>/developer/apache-tomcat-8.0.52/logs/mmall.log</File>
        <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
            <fileNamePattern>/developer/apache-tomcat-8.0.52/logs/mmall.log.%d{yyyy-MM-dd}.gz</fileNamePattern>
            <append>true</append>
            <maxHistory>10</maxHistory>
        </rollingPolicy>
        <encoder>
            <pattern>[%d{HH:mm:ss.SSS}][%p][%c{40}][%t] %m%n</pattern>
        </encoder>
    </appender>


    <appender name="error" class="ch.qos.logback.core.rolling.RollingFileAppender">
        <!--<File>d:/mmalllog/error.log</File>-->
        <File>/developer/apache-tomcat-8.0.52/logs/error.log</File>
        <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
            <fileNamePattern>/developer/apache-tomcat-8.0.52/logs/error.log.%d{yyyy-MM-dd}.gz</fileNamePattern>
            <!--<fileNamePattern>d:/mmalllog/error.log.%d{yyyy-MM-dd}.gz</fileNamePattern>-->
            <append>true</append>
            <maxHistory>10</maxHistory>
        </rollingPolicy>
        <encoder>
            <pattern>[%d{HH:mm:ss.SSS}][%p][%c{40}][%t] %m%n</pattern>
        </encoder>
        <filter class="ch.qos.logback.classic.filter.LevelFilter">
            <level>ERROR</level>
            <onMatch>ACCEPT</onMatch>
            <onMismatch>DENY</onMismatch>
        </filter>
    </appender>

    <logger name="com.mmall" additivity="false" level="INFO" >
        <appender-ref ref="mmall" />
        <appender-ref ref="console"/>
    </logger>



    <!-- geelynote mybatis log 日志 -->

    <logger name="com.mmall.dao" level="DEBUG"/>

    <!--<logger name="com.ibatis.sqlmap.engine.impl.SqlMapClientDelegate" level="DEBUG" >-->
        <!--<appender-ref ref="console"/>-->
    <!--</logger>-->

    <!--<logger name="java.sql.Connection" level="DEBUG">-->
        <!--<appender-ref ref="console"/>-->
    <!--</logger>-->
    <!--<logger name="java.sql.Statement" level="DEBUG">-->
        <!--<appender-ref ref="console"/>-->
    <!--</logger>-->

    <!--<logger name="java.sql.PreparedStatement" level="DEBUG">-->
        <!--<appender-ref ref="console"/>-->
    <!--</logger>-->


    <root level="DEBUG">
        <appender-ref ref="console"/>
        <appender-ref ref="error"/>
    </root>

</configuration>

ftp服务器配置mmall.properties

主要有下面这些配置项,等我们开发到后面时再完善

ftp.server.ip=
ftp.user=
ftp.pass=
ftp.server.http.prefix=
alipay.callback.url=
password.salt =

项目初始化代码提交

至此我们完成了项目的初始化,接下来将项目初始化文件提交到GitHub上。

$ git status

On branch v1.0
Your branch is up to date with 'origin/v1.0'.

Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)

        modified:   .gitignore
        modified:   pom.xml
        modified:   src/main/webapp/WEB-INF/web.xml

Untracked files:
  (use "git add <file>..." to include in what will be committed)

        src/main/java/
        src/main/resources/
        src/main/tools/
        src/main/webapp/WEB-INF/dispatcher-servlet.xml

no changes added to commit (use "git add" and/or "git commit -a")

$ git add .

warning: LF will be replaced by CRLF in src/main/webapp/WEB-INF/web.xml.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in src/main/resources/applicationContext-datasource.xml.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in src/main/resources/applicationContext.xml.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in src/main/resources/generatorConfig.xml.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in src/main/resources/logback.xml.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in src/main/resources/mappers/CartMapper.xml.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in src/main/resources/mappers/CategoryMapper.xml.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in src/main/resources/mappers/OrderItemMapper.xml.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in src/main/resources/mappers/OrderMapper.xml.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in src/main/resources/mappers/PayInfoMapper.xml.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in src/main/resources/mappers/ProductMapper.xml.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in src/main/resources/mappers/ShippingMapper.xml.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in src/main/resources/mappers/UserMapper.xml.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in src/main/resources/mmall.properties.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in src/main/webapp/WEB-INF/dispatcher-servlet.xml.
The file will have its original line endings in your working directory.

$ git status

On branch v1.0
Your branch is up to date with 'origin/v1.0'.

Changes to be committed:
  (use "git reset HEAD <file>..." to unstage)

        modified:   .gitignore
        modified:   pom.xml
        new file:   src/main/java/com/mmall/dao/CartMapper.java
        new file:   src/main/java/com/mmall/dao/CategoryMapper.java
        new file:   src/main/java/com/mmall/dao/OrderItemMapper.java
        new file:   src/main/java/com/mmall/dao/OrderMapper.java
        new file:   src/main/java/com/mmall/dao/PayInfoMapper.java
        new file:   src/main/java/com/mmall/dao/ProductMapper.java
        new file:   src/main/java/com/mmall/dao/ShippingMapper.java
        new file:   src/main/java/com/mmall/dao/UserMapper.java
        new file:   src/main/java/com/mmall/pojo/Cart.java
        new file:   src/main/java/com/mmall/pojo/Category.java
        new file:   src/main/java/com/mmall/pojo/Order.java
        new file:   src/main/java/com/mmall/pojo/OrderItem.java
        new file:   src/main/java/com/mmall/pojo/PayInfo.java
        new file:   src/main/java/com/mmall/pojo/Product.java
        new file:   src/main/java/com/mmall/pojo/Shipping.java
        new file:   src/main/java/com/mmall/pojo/User.java
        new file:   src/main/resources/applicationContext-datasource.xml
        new file:   src/main/resources/applicationContext.xml
        new file:   src/main/resources/datasource.properties
        new file:   src/main/resources/generatorConfig.xml
        new file:   src/main/resources/logback.xml
        new file:   src/main/resources/mappers/CartMapper.xml
        new file:   src/main/resources/mappers/CategoryMapper.xml
        new file:   src/main/resources/mappers/OrderItemMapper.xml
        new file:   src/main/resources/mappers/OrderMapper.xml
        new file:   src/main/resources/mappers/PayInfoMapper.xml
        new file:   src/main/resources/mappers/ProductMapper.xml
        new file:   src/main/resources/mappers/ShippingMapper.xml
        new file:   src/main/resources/mappers/UserMapper.xml
        new file:   src/main/resources/mmall.properties
        new file:   src/main/tools/mysql-connector-java-5.1.6-bin.jar
        new file:   src/main/webapp/WEB-INF/dispatcher-servlet.xml
        modified:   src/main/webapp/WEB-INF/web.xml

$ git commit -am ‘project init commit’

[v1.0 fff56e7] project init commit
 35 files changed, 3406 insertions(+), 77 deletions(-)
 rewrite pom.xml (72%)
 create mode 100644 src/main/java/com/mmall/dao/CartMapper.java
 create mode 100644 src/main/java/com/mmall/dao/CategoryMapper.java
 create mode 100644 src/main/java/com/mmall/dao/OrderItemMapper.java
 create mode 100644 src/main/java/com/mmall/dao/OrderMapper.java
 create mode 100644 src/main/java/com/mmall/dao/PayInfoMapper.java
 create mode 100644 src/main/java/com/mmall/dao/ProductMapper.java
 create mode 100644 src/main/java/com/mmall/dao/ShippingMapper.java
 create mode 100644 src/main/java/com/mmall/dao/UserMapper.java
 create mode 100644 src/main/java/com/mmall/pojo/Cart.java
 create mode 100644 src/main/java/com/mmall/pojo/Category.java
 create mode 100644 src/main/java/com/mmall/pojo/Order.java
 create mode 100644 src/main/java/com/mmall/pojo/OrderItem.java
 create mode 100644 src/main/java/com/mmall/pojo/PayInfo.java
 create mode 100644 src/main/java/com/mmall/pojo/Product.java
 create mode 100644 src/main/java/com/mmall/pojo/Shipping.java
 create mode 100644 src/main/java/com/mmall/pojo/User.java
 create mode 100644 src/main/resources/applicationContext-datasource.xml
 create mode 100644 src/main/resources/applicationContext.xml
 create mode 100644 src/main/resources/datasource.properties
 create mode 100644 src/main/resources/generatorConfig.xml
 create mode 100644 src/main/resources/logback.xml
 create mode 100644 src/main/resources/mappers/CartMapper.xml
 create mode 100644 src/main/resources/mappers/CategoryMapper.xml
 create mode 100644 src/main/resources/mappers/OrderItemMapper.xml
 create mode 100644 src/main/resources/mappers/OrderMapper.xml
 create mode 100644 src/main/resources/mappers/PayInfoMapper.xml
 create mode 100644 src/main/resources/mappers/ProductMapper.xml
 create mode 100644 src/main/resources/mappers/ShippingMapper.xml
 create mode 100644 src/main/resources/mappers/UserMapper.xml
 create mode 100644 src/main/resources/mmall.properties
 create mode 100644 src/main/tools/mysql-connector-java-5.1.6-bin.jar
 create mode 100644 src/main/webapp/WEB-INF/dispatcher-servlet.xml
 rewrite src/main/webapp/WEB-INF/web.xml (93%)

$ git push

Counting objects: 49, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (46/46), done.
Writing objects: 100% (49/49), 679.67 KiB | 1.44 MiB/s, done.
Total 49 (delta 19), reused 0 (delta 0)
remote: Resolving deltas: 100% (19/19), completed with 1 local object.
To github.com:geekerstar/mmall.git
   5b9c632..fff56e7  v1.0 -> v1.0


丨极客文库, 版权所有丨如未注明 , 均为原创丨
本网站采用知识共享署名-非商业性使用-相同方式共享 3.0 中国大陆许可协议进行授权
转载请注明原文链接:从零到企业级SSM电商项目实战教程(十七)logback和ftp服务器配置
喜欢 (0)
[247507792@qq.com]
分享 (0)
Geekerstar
关于作者:
本站技术支持

您必须 登录 才能发表评论!

  • 精品技术教程
  • 编程资源分享
  • 问答交流社区
  • 极客文库知识库

客服QQ


QQ:2248886839


工作时间:09:00-23:00