add logger
This commit is contained in:
parent
79010d1a1e
commit
ba51cd979a
|
@ -9,6 +9,7 @@ import java.util.List;
|
|||
import java.util.UUID;
|
||||
|
||||
import org.apache.commons.io.FileUtils;
|
||||
import org.apache.log4j.Logger;
|
||||
import org.bench4q.master.api.model.OperateScriptServerResponseModel;
|
||||
import org.bench4q.master.entity.db.Port;
|
||||
import org.bench4q.master.entity.db.Script;
|
||||
|
@ -30,6 +31,7 @@ public class ScriptController extends BaseController {
|
|||
private ScriptService scriptService;
|
||||
private PortPoolService portPoolService = new PortPoolService();
|
||||
private static final Object PORT_LOCK = new Object();
|
||||
private Logger logger = Logger.getLogger(ScriptController.class);
|
||||
|
||||
public ScriptCapturer getScriptCapturer() {
|
||||
return scriptCapturer;
|
||||
|
@ -144,10 +146,11 @@ public class ScriptController extends BaseController {
|
|||
null, fileNameUUID);
|
||||
}
|
||||
try {
|
||||
String content = FileUtils.readFileToString(file);
|
||||
logger.info("when saveToDB, scriptContent is " + content);
|
||||
return buildReponseModel(
|
||||
this.getScriptService().saveScriptToDB(scriptName,
|
||||
this.getPrincipal().getId(),
|
||||
FileUtils.readFileToString(file)),
|
||||
this.getPrincipal().getId(), content),
|
||||
"Save to DataBase!!", "", port, null, null, null);
|
||||
} catch (Exception e) {
|
||||
return buildReponseModel(false, "exception when read from file",
|
||||
|
|
Loading…
Reference in New Issue