fixbug 按次收费余额不足就下订单
音乐多次播放有问题,上传日志有问题
This commit is contained in:
@@ -16,28 +16,24 @@ public class LogService {
|
||||
|
||||
private static SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
||||
|
||||
static Session session;
|
||||
|
||||
public void uploadLog(String password) {
|
||||
public void uploadLog() {
|
||||
try {
|
||||
if (session == null) {
|
||||
JSch jsch = new JSch();
|
||||
String serverIp = System.getProperty(NettyConstant.VENUE_SERVER_IP);
|
||||
session = jsch.getSession("root", serverIp, 22);
|
||||
session.setPassword(System.getProperty(NettyConstant.VENUE_CHECK_PWD));
|
||||
session.setConfig("StrictHostKeyChecking", "no");
|
||||
session.connect(3000);
|
||||
}
|
||||
JSch jsch = new JSch();
|
||||
String serverIp = System.getProperty(NettyConstant.VENUE_SERVER_IP);
|
||||
Session session = jsch.getSession("root", serverIp, 22);
|
||||
session.setPassword(System.getProperty(NettyConstant.VENUE_CHECK_PWD));
|
||||
session.setConfig("StrictHostKeyChecking", "no");
|
||||
session.connect(3000);
|
||||
ChannelSftp sftp = (ChannelSftp) session.openChannel("sftp");
|
||||
File file1 = new File("/home/venue/logs/common-default.log");
|
||||
File file2 = new File("/home/venue/logs/common-error.log");
|
||||
if (file1.exists() || file2.exists()) {
|
||||
sftp.connect();
|
||||
if (file1.exists()){
|
||||
sftp.put(new FileInputStream(file1), "/home/uploadlog/" + System.getProperty(NettyConstant.VENUE_CLIENT_SN) + "-" + sdf.format(new Date()) + "-client-common.log");
|
||||
sftp.put(new FileInputStream(file1), "/home/uploadlog/comm-" + System.getProperty(NettyConstant.VENUE_CLIENT_SN) + "-" + sdf.format(new Date()) + "-client.log");
|
||||
}
|
||||
if (file2.exists()) {
|
||||
sftp.put(new FileInputStream(file2), "/home/uploadlog/" + System.getProperty(NettyConstant.VENUE_CLIENT_SN) + "-" + sdf.format(new Date()) + "-client-error.log");
|
||||
sftp.put(new FileInputStream(file2), "/home/uploadlog/error-" + System.getProperty(NettyConstant.VENUE_CLIENT_SN) + "-" + sdf.format(new Date()) + "-client.log");
|
||||
}
|
||||
logger.info("upload logs success");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user