About Tomcat under multiple projects configure a log4j.properties, to output the respective log of the problem,
After the actual work of the summary and investigation, here to make a summary and memo.
To lift the log4j configuration, our common configuration method is to create a log4j.properties file for each project and write the information of its own output
Spring injects attributes according to the XML configuration file, and Spring XML configuration file
Method 1 use the setter Method
package com.swift;public class Book { private String bookName; public void setBook(String bookName) { this.bookName = bookName; } @Override public String toString() {
;Importorg.springframework.web.bind.annotation.RequestMapping;ImportOrg.springframework.web.bind.annotation.ResponseBody;ImportOrg.springframework.web.bind.annotation.RestController;ImportCom.alibaba.fastjson.JSON;ImportYxm.zyf.love.domian.RoomDO;ImportYxm.zyf.love.mapper.RoomMapper;ImportYxm.zyf.love.utils.LoggerUtil;ImportYxm.zyf.love.utils.StringUtil;ImportYxm.zyf.love.utils.URLencord;Importyxm.zyf.love.vo.payVo; @RestController Public classHospitalpay {Private Final StaticLogger Logger = Log
LOG4J has a total of 5 log output levels:
FATAL (0)
Example:
Log4j.rootlogger=debug,console, FileThe above settings can crawl throw new RuntimeException ();Log4j.rootlogger=info,console, FileInfo level can not catch throw new RuntimeException ();
The reason is that this error belongs to the DEBUG level debug>info>error so INFO can't catch it.
Console output log information configuration, such as:
M
Log4j.logger.com.ibatis=debuglog4j.logger.com.ibatis.common.jdbc.simpledatasource= Debuglog4j.logger.com.ibatis.common.jdbc.scriptrunner= debuglog4j.logger.com.ibatis.sqlmap.engine.impl.sqlmapclientdelegate=debuglog4j.logger.java.sql.connection= Debuglog4j.logger.java.sql.statement=debuglog4j.logger.java.sql.preparedstatement=debugThis article is from the "bit accumulation" blog, please be sure to keep this source http://tianxingzhe.blog.51cto.com/3390077/1741292MyBatis Display SQL statement
The configuration template of the hibernate. cfg. xml file and the configuration parameters of different databases, hibernate. cfg. xml
(1) configuration template of the hibernate. cfg. xml file
(2) The above knowledge introduce
Play Spring Boot Custom configuration, import XML configuration and external configurationHere I'll give you a full description of how to customize the configuration in spring boot, change the spring boot default configuration, and describe the order of precedence for each
For configuration file trade-offs,. config VS. xml,. config. xml
As we all know, some of the flexibility of the program is "configuration.
Of course, the config file has never been easy for. NET users. At least, I think it is very troublesome.
1. config
. NET configuration
The path of the file introduced by the web. xml configuration during Spring MVC setup, mvcweb. xml
I am a relatively low person, haha. Originally, I had limited technology and had nothing to do. I had to prepare my own environment for fun. The results were blinded by various basic problems. Let's talk about the problem.
1. First, let's talk about the compiled jav
SpringMVC configuration web. xml file (list common configurations), springmvcweb. xml
Common web. xml configuration
1. Spring framework solves the string encoding problem: FilterCharacterEncodingFilter(Filter-name)2. Configure the listener in web. xmlContextLoaderListener(Li
ImplementsServletcontextlistener {....
Startuplistener inherits from servletcontextlistener. Therefore, this listener is called when the container initializes servletcontext. The Web. xml of the appfuse application contains spring configuration information, so we have configured spring here !!!
Filter: Filter Lifecycle
After a web project is released, the engine must locate the Filter list before requestin
Spring configuration in web. xml: springweb. xml
Spring configuration in web. xml
Preface
In actual projects, the spring configuration file applicationcontext. xml is automatically load
Web. xml and web. xml configuration details
The web. xml deployment descriptor file is the configuration file for the web application, located in the WEB-INF directory. The Servlet container specifies the specific Servlet to process the specific request of the client accordi
Easy access to various types of databases, database. xml file configuration methods, database. xml
The light-Open Platform theoretically supports all databases that can be accessed through JDBC or ODBCSuch:
MySQL
SQL Server MS
Oracle
SyBase
DB2
Infomix
Teradata
...And MPP architecture Vertica
You can access the above database simply by configuring the
Implement site configuration files and XML serialization using xml serialization and Asp. Net Web Cache
We often encounter such scenarios:We have a business today. We need to add a field, but there may be changes in the future. We need to configure it as "active.In general, the initial method is to add a configuration
the target properties you have already done. For example, if the Author table above already uses an automatically generated column type for the ID, the statement can be modified to: Insert into User (Id,username,password,email,bio) VALUES (#{id},#{username},#{password},#{email}) MyBatis there is another way to generate a primary key for a database that does not support auto-generated types, such as Oracle, or for JDBC drivers that might not support auto-generating primary keys. s
1. How to add a configuration file for Web. XML to the war project in ideaThe idea of creating a war project through Maven did not specify a folder that was WebApp caused the project to be created without webapp. In fact, the War project is under the "Project name/src/main" directory.Just create a webapp/web-inf/web.xml under this project.2, if you do not put the Web. X
Spring AOP-configuration based on XML files, aop-xml
The configuration of Spring AOP can be based on Annotations or XML files. The previous articles use annotations. The following describes how to configure an XML file.
The used t
In ASP. NET, xml deserialization and cache dependency are used to bring personalized configuration files into effect in real time. xml serialization
Because many configuration attributes exist and multiple groups of attributes, the configuration culture can be automatically
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.