客户端 fixbug 开启上传日志功能
This commit is contained in:
@@ -32,11 +32,11 @@ public class LogService {
|
|||||||
ChannelSftp sftp = (ChannelSftp) session.openChannel("sftp");
|
ChannelSftp sftp = (ChannelSftp) session.openChannel("sftp");
|
||||||
File file = new File("/home/venue/logs/common-default.log");
|
File file = new File("/home/venue/logs/common-default.log");
|
||||||
if (file.exists()) {
|
if (file.exists()) {
|
||||||
|
sftp.connect();
|
||||||
sftp.put(new FileInputStream(file), "/home/uploadlog/" + System.getProperty(NettyConstant.VENUE_CLIENT_SN) + "-" + sdf.format(new Date()) + "-client.log");
|
sftp.put(new FileInputStream(file), "/home/uploadlog/" + System.getProperty(NettyConstant.VENUE_CLIENT_SN) + "-" + sdf.format(new Date()) + "-client.log");
|
||||||
logger.info("上传日志成功");
|
logger.info("上传日志成功");
|
||||||
}
|
}
|
||||||
if (sftp != null) {
|
if (sftp != null) {
|
||||||
sftp.connect();
|
|
||||||
sftp.disconnect();
|
sftp.disconnect();
|
||||||
}
|
}
|
||||||
if (session != null) {
|
if (session != null) {
|
||||||
|
|||||||
Reference in New Issue
Block a user