| | |
| | | |
| | | import com.vci.ubcs.core.log.service.ILogSystemService; |
| | | import com.vci.ubcs.log.entity.SystemLog; |
| | | import com.vci.ubcs.resource.bo.FileObjectBO; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.io.File; |
| | | import java.rmi.ServerException; |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 本地系统日志 |
| | | * @author ludc |
| | | * @date 2023/10/31 15:39 |
| | | */ |
| | | @Service |
| | | public class LogSystemServiceImpl implements ILogSystemService { |
| | | |
| | | /** |
| | | * 各个服务存放的的父路径 |
| | | */ |
| | | private final String parentPath = "/data1/ubcs/ubcs-server"; |
| | | //@Value("#{'${ip-whitelist.ip}'.split(',')}") |
| | | private List<String> serviceDirNames = new ArrayList<>(Arrays.asList("/ubcs_code/target/log","/ubcs_omd/target/log","/ubcs_system/target/log")); |
| | | |
| | | /** |
| | | * 获取本地日志列表 |
| | | */ |
| | | @Override |
| | | public List<SystemLog> getSystemLogList() { |
| | | serviceDirNames.stream().forEach(serviceDirName->{ |
| | | File file = new File(parentPath+serviceDirName); |
| | | |
| | | if(file.isDirectory()){ |
| | | |
| | | File[] files = file.listFiles(); |
| | | |
| | | for(File f : files){ |
| | | |
| | | if(f.isDirectory()){ |
| | | |
| | | //readAllFiles(f.getAbsolutePath()); |
| | | |
| | | }else{ |
| | | |
| | | System.out.println(f.getName()); |
| | | |
| | | } |
| | | |
| | | } |
| | | |
| | | }else{ |
| | | |
| | | System.out.println(file.getName()); |
| | | |
| | | } |
| | | |
| | | }); |
| | | |
| | | return null; |
| | | } |
| | | |
| | | @Override |
| | | public FileObjectBO downloadLogByServiceNameAndFileName(Map<String, String> condition) throws ServerException { |
| | | return null; |
| | | } |
| | | |
| | | @Override |
| | | public void deleteLogFile(Map<String, String> condition) throws ServerException { |
| | | |
| | | } |
| | | |
| | | |
| | | } |