mirror of
https://gitee.com/BDWare/cp.git
synced 2025-01-10 01:44:08 +00:00
support debug log and normal log
This commit is contained in:
parent
1229c9ce4c
commit
5f42ed082c
13
build.gradle
13
build.gradle
@ -6,7 +6,7 @@ plugins {
|
||||
}
|
||||
|
||||
group = "org.bdware.sc"
|
||||
version = "1.5.7"
|
||||
version = "1.6.0"
|
||||
repositories {
|
||||
mavenCentral()
|
||||
mavenLocal()
|
||||
@ -58,7 +58,7 @@ jar {
|
||||
}
|
||||
from {
|
||||
// uncomment this when publish!
|
||||
configurations.compile.collect { it.isDirectory() ? it : zipTree(it) }
|
||||
// configurations.compile.collect { it.isDirectory() ? it : zipTree(it) }
|
||||
}
|
||||
manifest {
|
||||
attributes 'Manifest-Version': project.version
|
||||
@ -75,10 +75,17 @@ task copyLibs(type: Copy, dependsOn: ":common:jar") {
|
||||
from configurations.runtimeClasspath
|
||||
}
|
||||
|
||||
task copyJar(type: Copy, dependsOn: ":cp:jar") {
|
||||
task copyJar(type: Copy, dependsOn: [":cp:jar",":copyLog4jProp"]) {
|
||||
into "./build/output/"
|
||||
from "./build/libs/$project.name-${version}.jar"
|
||||
rename { String fileName -> "yjs.jar" }
|
||||
from "./src/main/resources/log4j2.debug.properties"
|
||||
from "./src/main/resources/log4j2.properties"
|
||||
}
|
||||
task copyLog4jProp(type: Copy) {
|
||||
into "./build/output/"
|
||||
from "./src/main/resources/log4j2.debug.properties"
|
||||
from "./src/main/resources/log4j2.properties"
|
||||
}
|
||||
|
||||
task buildBundle(dependsOn: [":cp:copyLibs", ":cp:copyJar"]) {
|
||||
|
@ -63,7 +63,7 @@ public class DebugMain {
|
||||
= new ResultCallback() {
|
||||
@Override
|
||||
public void onResult(String str) {
|
||||
LOGGER.info(str);
|
||||
LOGGER.debug(str);
|
||||
}
|
||||
};
|
||||
ContractProcess.instance.handler.setDBInfo(wrap("", config.dbPath), printCallback);
|
||||
|
@ -722,7 +722,7 @@ public class ContractProcess {
|
||||
arg = new JsonPrimitive("");
|
||||
}
|
||||
onCreate.setArg(arg);
|
||||
LOGGER.info("invoke onCreate, param:" + onCreate.getArg().toString());
|
||||
LOGGER.debug("invoke onCreate, param:" + onCreate.getArg().toString());
|
||||
onCreate.setRequester(contract.getOwner());
|
||||
if (contract.getDoipFlag() && null != contract.getDOI() && !contract.getDOI().isEmpty()) {
|
||||
onCreate.setRequesterDOI(contract.getDOI());
|
||||
|
@ -1,8 +0,0 @@
|
||||
### 设置###
|
||||
log4j.rootLogger = debug,stdout
|
||||
|
||||
### 输出信息到控制抬 ###
|
||||
log4j.appender.stdout = org.apache.log4j.ConsoleAppender
|
||||
log4j.appender.stdout.Target = System.out
|
||||
log4j.appender.stdout.layout = org.apache.log4j.PatternLayout
|
||||
log4j.appender.stdout.layout.ConversionPattern = [%-5p] %d{HH:mm:ss.SSS} %m (%F:%L)[%M]%n
|
10
src/main/resources/log4j2.debug.properties
Normal file
10
src/main/resources/log4j2.debug.properties
Normal file
@ -0,0 +1,10 @@
|
||||
filter.threshold.type=ThresholdFilter
|
||||
filter.threshold.level=all
|
||||
appender.console.type=Console
|
||||
appender.console.name=STDOUT
|
||||
appender.console.layout.type=PatternLayout
|
||||
appender.console.layout.pattern=%highlight{[%-5p] %d{HH:mm:ss.SSS} %m (%F:%L)[%M]%n}{FATAL=Bright Red,ERROR=Red,WARN=Yellow,INFO=Green,DEBUG=Blue,TRACE=White}
|
||||
|
||||
rootLogger.level=all
|
||||
rootLogger.appenderRef.stdout.ref=STDOUT
|
||||
rootLogger.appenderRef.log.ref=log
|
@ -1,15 +1,10 @@
|
||||
filter.threshold.type=ThresholdFilter
|
||||
filter.threshold.level=debug
|
||||
filter.threshold.level=error
|
||||
appender.console.type=Console
|
||||
appender.console.name=STDOUT
|
||||
appender.console.layout.type=PatternLayout
|
||||
appender.console.layout.pattern=%highlight{[%-5p] %d{HH:mm:ss.SSS} %m (%F:%L)[%M]%n}{FATAL=Bright Red,ERROR=Red,WARN=Yellow,INFO=Green,DEBUG=Blue,TRACE=White}
|
||||
appender.rolling.type=File
|
||||
appender.rolling.name=log
|
||||
appender.rolling.append=true
|
||||
appender.rolling.fileName=./log/ct.log
|
||||
appender.rolling.layout.type=PatternLayout
|
||||
appender.rolling.layout.pattern=%d-%m%n
|
||||
rootLogger.level=info
|
||||
|
||||
rootLogger.level=error
|
||||
rootLogger.appenderRef.stdout.ref=STDOUT
|
||||
rootLogger.appenderRef.log.ref=log
|
Loading…
Reference in New Issue
Block a user