Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nouiWithSpringMVC
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
gechengyang
nouiWithSpringMVC
Commits
f640cfb9
Commit
f640cfb9
authored
Aug 28, 2020
by
cjh
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
http://exam.letrd.com:8900/gechengyang/nouiWithSpringMVC
parents
f647cbf6
842d76a4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
117 additions
and
3 deletions
+117
-3
pom.xml
pom.xml
+26
-1
eIBS.xml
src/main/resources/eIBS.xml
+0
-2
log4j2.xml
src/main/resources/log4j2.xml
+55
-0
ConnectionFactory.java
...a/org/sss/presentation/noui/log/db/ConnectionFactory.java
+36
-0
No files found.
pom.xml
View file @
f640cfb9
...
...
@@ -24,6 +24,7 @@
<project.build.sourceEncoding>
UTF-8
</project.build.sourceEncoding>
<!-- spring版本号 -->
<spring.version>
5.1.3.RELEASE
</spring.version>
<log4j2.version>
2.12.1
</log4j2.version>
</properties>
<dependencies>
...
...
@@ -290,7 +291,6 @@
<artifactId>
spring-context-support
</artifactId>
<version>
${spring.version}
</version>
</dependency>
<dependency>
<groupId>
org.springframework
</groupId>
<artifactId>
spring-test
</artifactId>
...
...
@@ -302,6 +302,31 @@
<version>
3.8.1
</version>
<scope>
test
</scope>
</dependency>
<dependency>
<groupId>
org.apache.logging.log4j
</groupId>
<artifactId>
log4j-core
</artifactId>
<version>
${log4j2.version}
</version>
</dependency>
<dependency>
<groupId>
org.apache.logging.log4j
</groupId>
<artifactId>
log4j-api
</artifactId>
<version>
${log4j2.version}
</version>
</dependency>
<dependency>
<groupId>
cfca.integration
</groupId>
<artifactId>
SADK
</artifactId>
<version>
3.2.0.5
</version>
</dependency>
<dependency>
<groupId>
com.alibaba
</groupId>
<artifactId>
druid
</artifactId>
<version>
1.1.23
</version>
</dependency>
<dependency>
<groupId>
com.lmax
</groupId>
<artifactId>
disruptor
</artifactId>
<version>
3.4.2
</version>
</dependency>
</dependencies>
<build>
<finalName>
business
</finalName>
...
...
src/main/resources/eIBS.xml
View file @
f640cfb9
...
...
@@ -22,8 +22,6 @@
</service>
-->
<service
class=
"org.sss.module.hibernate.HibernateUtils"
initMethodName=
"init"
deinitMethodName=
"deinit"
>
<!-- 生成代码基本包名(不可修改) -->
<property
name=
"packageName"
value=
"com.brilliance.eibs.etrade"
/>
<!-- 生成数据库脚本(设置全路径或相对路径,生成出来作为参考,为空则不生成) -->
<property
name=
"scriptFile"
value=
"/Users/JasonHoo/Downloads/eIBS.sql"
/>
<!-- 自动重建数据库表 -->
...
...
src/main/resources/log4j2.xml
0 → 100644
View file @
f640cfb9
<?xml version="1.0" encoding="UTF-8"?>
<Configuration
status=
"WARN"
>
<Appenders>
<Console
name=
"Console"
target=
"SYSTEM_OUT"
>
<PatternLayout
pattern=
"%d{yyyy-MM-dd'T'HH:mm:ss.SSS} [%-10t] %-5level %c{1} %ex{full} - %msg%n"
/>
</Console>
<!--自定义appender-->
<!-- <XXXFileAppender name="xxx" fileName="log.log" xxx="true">
<PatternLayout pattern="%d{yyyy-MM-dd'T'HH:mm:ss.SSS} [%t] %-5level %logger{36} - %msg%n"/>
</XXXFileAppender>-->
<JDBC
name=
"databaseAppender"
tableName=
"test.log"
>
<ThresholdFilter
level=
"ERROR"
onMatch=
"ACCEPT"
onMismatch=
"DENY"
/>
<ConnectionFactory
class=
"org.sss.presentation.noui.log.db.ConnectionFactory"
method=
"getDatabaseConnection"
/>
<Column
name=
"ID"
literal=
"'XXX'"
/>
<Column
name=
"MESSAGE"
pattern=
"%message"
/>
<Column
name=
"LEV"
pattern=
"%level"
/>
<Column
name=
"LOGGER"
pattern=
"%logger"
/>
<Column
name=
"THROWABLE"
pattern=
"%msg %ex{full}"
/>
<Column
name=
"eventDate"
isEventTimestamp=
"true"
/>
</JDBC>
</Appenders>
<Loggers>
<!--异步方式入库-->
<!--<AsyncLogger name="org.sss" level="ERROR" includeLocation="true" additivity="false">
<AppenderRef ref="databaseAppender"/>
</AsyncLogger>-->
<!--<Logger name="org.sss" level="INFO" additivity="false">
<Filters>
<ThresholdFilter level="INFO" onMatch="NEUTRAL" onMismatch="DENY"/>
<RegexFilter regex="测试.*" onMatch="NEUTRAL" onMismatch="DENY"/>
<TimeFilter start="05:00:00" end="23:30:00" onMatch="NEUTRAL" onMismatch="DENY"/>
</Filters>
<AppenderRef ref="Console"/>
</Logger>-->
<AsyncLogger
name=
"org.sss"
level=
"INFO"
includeLocation=
"true"
additivity=
"true"
>
<AppenderRef
ref=
"databaseAppender"
/>
</AsyncLogger>
<AsyncLogger
name=
"org.hibernate"
level=
"ERROR"
includeLocation=
"true"
>
<AppenderRef
ref=
"databaseAppender"
/>
</AsyncLogger>
<AsyncLogger
name=
"org.apache"
level=
"ERROR"
includeLocation=
"true"
>
<AppenderRef
ref=
"databaseAppender"
/>
</AsyncLogger>
<AsyncLogger
name=
"com.opensymphony"
level=
"ERROR"
includeLocation=
"true"
>
<AppenderRef
ref=
"databaseAppender"
/>
</AsyncLogger>
<Root
level=
"ALL"
>
<AppenderRef
ref=
"Console"
/>
</Root>
</Loggers>
</Configuration>
\ No newline at end of file
src/test/java/org/sss/presentation/noui/log/db/ConnectionFactory.java
0 → 100644
View file @
f640cfb9
package
org
.
sss
.
presentation
.
noui
.
log
.
db
;
import
com.alibaba.druid.pool.DruidDataSourceFactory
;
import
javax.sql.DataSource
;
import
java.sql.Connection
;
import
java.sql.SQLException
;
import
java.util.Properties
;
public
class
ConnectionFactory
{
private
final
DataSource
dataSource
;
private
ConnectionFactory
()
{
Properties
properties
=
new
Properties
();
properties
.
setProperty
(
"driverClassName"
,
"com.mysql.jdbc.Driver"
);
properties
.
setProperty
(
"url"
,
"jdbc:mysql://127.0.0.1:3306/test"
);
properties
.
setProperty
(
"username"
,
"root"
);
properties
.
setProperty
(
"password"
,
"666666"
);
properties
.
setProperty
(
"initialSize"
,
"1"
);
properties
.
setProperty
(
"maxActive"
,
"5"
);
properties
.
setProperty
(
"maxWait"
,
"3000"
);
try
{
this
.
dataSource
=
DruidDataSourceFactory
.
createDataSource
(
properties
);
}
catch
(
Exception
e
)
{
throw
new
RuntimeException
(
"创建druid数据源异常"
,
e
);
}
}
public
static
Connection
getDatabaseConnection
()
throws
SQLException
{
return
Singleton
.
INSTANCE
.
dataSource
.
getConnection
();
}
private
static
interface
Singleton
{
final
ConnectionFactory
INSTANCE
=
new
ConnectionFactory
();
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment