java逐行读取文件(读取文件每一行、按行读取文件)附带详细代码
BufferedReader
最快的读取每一行
@Test public void bufferReaderTest() { try (BufferedReader bufferedReader = new BufferedReader(new FileReader("D:\\aa.txt"))) { String line; while ((line = bufferedReader.readLine()) != null) { // 处理每一行数据 ..... } } catch (Exception e) { log.error(e.getMessage(), e); } }
Scanner
相比较Scanner慢一点
@Test public void scannerTest() { try (Scanner scanner = new Scanner(new File("D:\\aa.txt"))) { while (scanner.hasNextLine()) { // 处理每一行数据 ..... String line = scanner.nextLine(); } } catch (Exception e) { log.error(e.getMessage(), e); } }
RandomAccessFile
行数达到一定规模,使用此方法读取会非常慢
@Test public void randomAccessFileTest() { try (RandomAccessFile accessFile = new RandomAccessFile("D:\\aa.txt", "r")) { String line; while ((line = accessFile.readLine()) != null) { // 处理每一行数据 ..... } } catch (Exception e) { log.error(e.getMessage(), e); } }
Files
一次把所有数据都读到内存中,当文件非常大时,会消耗掉内存资源导致程序崩掉,文件规模小推荐使用
@Test public void filesTest() { try { List<String> lines = Files.readAllLines(Paths.get("D:\\aa.txt")); lines.forEach(line -> { // 处理每一行数据 ..... }); } catch (Exception e) { log.error(e.getMessage(), e); } }
示例代码
统计每一行日志ip出现的次数
package io; import lombok.extern.slf4j.Slf4j; import org.junit.Test; import java.io.BufferedReader; import java.io.File; import java.io.FileReader; import java.io.RandomAccessFile; import java.nio.file.Files; import java.nio.file.Paths; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Scanner; /** * @Author: Lisy * @Date: 2023/04/17/9:51 * @Description: 读取文件中每一行的数据 */ @Slf4j public class ReadLineTest { private final String FILE_NAME = "D:\\aa.txt"; private Map<String, Integer> StringMap = new HashMap<>(); @Test public void bufferReaderTest() { try (BufferedReader bufferedReader = new BufferedReader(new FileReader("D:\\aa.txt"))) { String line; while ((line = bufferedReader.readLine()) != null) { // 处理每一行数据 ..... processLines(line); } } catch (Exception e) { log.error(e.getMessage(), e); } print("BufferedReader"); } @Test public void scannerTest() { try (Scanner scanner = new Scanner(new File(FILE_NAME))) { while (scanner.hasNextLine()) { // 处理每一行数据 ..... String line = scanner.nextLine(); processLines(line); } } catch (Exception e) { log.error(e.getMessage(), e); } print("Scanner"); } @Test public void randomAccessFileTest() { try (RandomAccessFile accessFile = new RandomAccessFile(FILE_NAME, "r")) { String line; while ((line = accessFile.readLine()) != null) { // 处理每一行数据 ..... processLines(line); } } catch (Exception e) { log.error(e.getMessage(), e); } print("RandomAccessFile"); } @Test public void filesTest() { try { List<String> lines = Files.readAllLines(Paths.get(FILE_NAME)); // lines.forEach(line -> { // // 处理每一行数据 ..... // processLines(line); // }); // 处理每一行数据 .....,方法引用更简洁 lines.forEach(this::processLines); } catch (Exception e) { log.error(e.getMessage(), e); } print("Files.readAllLines"); } private void print(String name) { log.info("************* {} *******************", name); StringMap.forEach((k, v) -> { if (v != 1) { log.info("ip: {} count: {}", k, v); } }); StringMap.clear(); } private void processLines(String line) { String[] subLine = line.split(" "); String ip = subLine[subLine.length - 1]; if (StringMap.containsKey(ip)) { Integer integer = StringMap.get(ip); StringMap.put(ip, integer + 1); } else { StringMap.put(ip, 1); } } }
测试数据
2023-04-14 09:50:51,211 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 192.168.8.172
2023-04-14 09:50:51,211 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 172.31.106.64
2023-04-14 09:50:51,212 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 172.31.106.64
2023-04-14 09:50:51,212 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 172.31.106.69
2023-04-14 09:50:51,212 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 192.168.8.159
2023-04-14 09:50:51,212 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 192.168.8.161
2023-04-14 09:50:51,213 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 172.31.93.68
2023-04-14 09:50:51,213 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 192.168.8.186
2023-04-14 09:50:51,213 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 172.31.93.74
2023-04-14 09:50:51,213 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 172.31.106.64
2023-04-14 09:50:51,214 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 172.31.106.64
2023-04-14 09:50:51,214 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 172.31.106.95
2023-04-14 09:50:51,214 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 172.31.106.87
2023-04-14 09:50:51,214 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 172.31.93.127
2023-04-14 09:50:51,215 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 172.31.106.91
2023-04-14 09:50:51,215 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 172.31.93.115
2023-04-14 09:50:51,216 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 192.168.8.198
2023-04-14 09:50:51,216 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 172.31.106.105
2023-04-14 09:50:51,216 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 172.31.106.60
2023-04-14 09:50:51,216 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 172.31.106.60
2023-04-14 09:50:51,217 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 172.31.106.77
2023-04-14 09:50:51,217 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 172.31.93.125
2023-04-14 09:50:51,217 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 172.31.106.60
2023-04-14 09:50:51,217 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 192.168.8.173
2023-04-14 09:50:51,218 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 172.31.106.129
2023-04-14 09:50:51,218 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 192.168.8.208
2023-04-14 09:50:51,218 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 192.168.8.211
2023-04-14 09:50:51,218 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 172.31.106.63
2023-04-14 09:50:51,219 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 192.168.8.170
2023-04-14 09:50:51,219 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 192.168.8.195
2023-04-14 09:50:51,219 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 192.168.8.181
2023-04-14 09:50:51,219 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 192.168.8.180
2023-04-14 09:50:51,220 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 172.31.106.61
2023-04-14 09:50:51,220 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 192.168.8.201
2023-04-14 09:50:51,220 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 172.31.106.90
2023-04-14 09:50:51,220 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 172.31.93.26
2023-04-14 09:50:51,221 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 192.168.8.200
2023-04-14 09:50:51,221 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 172.31.106.126
2023-04-14 09:50:51,221 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 192.168.8.192
2023-04-14 09:50:51,221 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 172.31.106.96
2023-04-14 09:50:51,221 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 172.31.93.59
2023-04-14 09:50:51,222 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 172.31.93.50
2023-04-14 09:50:51,222 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 172.31.106.64
2023-04-14 09:50:51,222 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 172.31.106.64
2023-04-14 09:50:51,223 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 172.31.106.125
2023-04-14 09:50:51,223 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 172.31.106.82
2023-04-14 09:50:51,223 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 192.168.8.150
2023-04-14 09:50:51,223 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 192.168.8.209
2023-04-14 09:50:51,224 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 172.31.106.170
2023-04-14 09:50:51,224 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 172.31.93.51
2023-04-14 09:50:51,224 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 192.168.8.152
2023-04-14 09:50:51,224 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 172.31.93.21
2023-04-14 09:50:51,224 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 172.31.106.71
2023-04-14 09:50:51,225 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 172.31.106.88
2023-04-14 09:50:51,225 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 192.168.8.188
2023-04-14 09:50:51,225 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 192.168.8.187
2023-04-14 09:50:51,225 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 172.31.106.81
2023-04-14 09:50:51,226 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 192.168.8.155
2023-04-14 09:50:51,226 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 172.31.93.57
2023-04-14 09:50:51,226 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 192.168.8.148
2023-04-14 09:50:51,226 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 192.168.8.156
2023-04-14 09:50:51,226 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 192.168.8.154
2023-04-14 09:50:51,227 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 192.168.8.146
2023-04-14 09:50:51,227 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 192.168.8.160
2023-04-14 09:50:51,227 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 172.31.106.60
2023-04-14 09:50:51,227 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 172.31.93.123
2023-04-14 09:50:51,227 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 172.31.106.60
2023-04-14 09:50:51,228 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 192.168.8.184
2023-04-14 09:50:51,228 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 192.168.8.151
2023-04-14 09:50:51,228 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 192.168.8.182
2023-04-14 09:50:51,229 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 172.31.93.113
2023-04-14 09:50:51,229 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 172.31.106.89
2023-04-14 09:50:51,229 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 192.168.8.191
2023-04-14 09:50:51,229 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 192.168.8.205
2023-04-14 09:50:51,229 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 172.31.106.60
2023-04-14 09:50:51,230 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 172.31.106.74
2023-04-14 09:50:51,230 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 172.31.106.127
2023-04-14 09:50:51,230 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 192.168.8.157
2023-04-14 09:50:51,230 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 192.168.8.165
2023-04-14 09:50:51,231 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 172.31.93.122
2023-04-14 09:50:51,231 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 192.168.8.162
2023-04-14 09:50:51,231 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 192.168.8.183
2023-04-14 09:50:51,231 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 192.168.8.202
2023-04-14 09:50:51,232 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 192.168.8.166
2023-04-14 09:50:51,232 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 172.31.106.64
2023-04-14 09:50:51,234 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 192.168.8.210
2023-04-14 09:50:51,234 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 172.31.106.93
2023-04-14 09:50:51,234 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 192.168.8.171
2023-04-14 09:50:51,234 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 192.168.8.204
2023-04-14 09:50:51,235 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 192.168.8.207
2023-04-14 09:50:51,235 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 192.168.8.199
2023-04-14 09:50:51,235 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 172.31.106.124
2023-04-14 09:50:51,235 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 172.31.106.64
2023-04-14 09:50:51,236 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 172.31.106.123
2023-04-14 09:50:51,236 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 172.31.106.107
2023-04-14 09:50:51,236 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 192.168.8.169
2023-04-14 09:50:51,236 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 172.31.106.76
2023-04-14 09:50:51,236 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 172.31.106.94
2023-04-14 09:50:51,237 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 192.168.8.176
2023-04-14 09:50:51,237 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 172.31.93.24
2023-04-14 09:50:51,237 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 192.168.8.177
2023-04-14 09:50:51,237 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 172.31.93.23
2023-04-14 09:50:51,238 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 192.168.8.149
2023-04-14 09:50:51,238 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 172.31.106.75
2023-04-14 09:50:51,238 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 172.31.106.62
2023-04-14 09:50:51,239 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 172.31.106.64
2023-04-14 09:50:51,239 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 172.31.106.64
2023-04-14 09:50:51,239 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 172.31.106.70
2023-04-14 09:50:51,239 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 192.168.8.197
2023-04-14 09:50:51,239 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 172.31.106.60
2023-04-14 09:50:51,240 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 192.168.8.174
2023-04-14 09:50:51,240 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 172.31.93.114
2023-04-14 09:50:51,240 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 172.31.93.121
2023-04-14 09:50:51,240 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 192.168.8.189
2023-04-14 09:50:51,241 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 172.31.106.106
2023-04-14 09:50:51,241 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 172.31.93.126
2023-04-14 09:50:51,241 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 192.168.8.153
2023-04-14 09:50:51,241 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 192.168.8.167
2023-04-14 09:50:51,242 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 172.31.106.60
2023-04-14 09:50:51,242 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 192.168.8.190
2023-04-14 09:50:51,242 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 192.168.8.175
2023-04-14 09:50:51,242 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 192.168.8.206
2023-04-14 09:50:51,243 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 172.31.106.108
2023-04-14 09:50:51,243 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 172.31.93.112
2023-04-14 09:50:51,243 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 192.168.8.194
2023-04-14 09:50:51,243 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 172.31.93.25
2023-04-14 09:50:51,244 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 192.168.8.185
2023-04-14 09:50:51,244 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 192.168.8.179
2023-04-14 09:50:51,244 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 172.31.106.60
2023-04-14 09:50:51,244 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 172.31.106.64
2023-04-14 09:50:51,245 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 172.31.93.117
2023-04-14 09:50:51,245 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 172.31.106.64
2023-04-14 09:50:51,245 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 192.168.8.193
2023-04-14 09:50:51,245 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 172.31.106.92
2023-04-14 09:50:51,245 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 192.168.8.147
2023-04-14 09:50:51,246 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 172.31.93.116
2023-04-14 09:50:51,246 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 172.31.106.101
2023-04-14 09:50:51,246 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 192.168.8.196
2023-04-14 09:50:51,246 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 192.168.8.203
2023-04-14 09:50:51,246 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 172.31.106.86
2023-04-14 09:50:51,247 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 192.168.8.163
2023-04-14 09:50:51,247 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 192.168.8.178
2023-04-14 09:50:51,247 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 172.31.93.67
2023-04-14 09:50:51,247 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 172.31.106.97
2023-04-14 09:50:51,248 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 192.168.8.145
2023-04-14 09:50:51,248 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 192.168.8.158
2023-04-14 09:50:51,248 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 172.31.93.124
2023-04-14 09:50:51,248 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 172.31.93.111
2023-04-14 09:50:51,248 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 172.31.93.99
2023-04-14 09:50:51,249 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 172.31.106.128
2023-04-14 09:50:51,249 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 192.168.8.168
2023-04-14 09:50:51,249 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 172.31.93.128
2023-04-14 09:50:51,249 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 172.31.93.22
2023-04-14 09:50:51,252 INFO [SpringContextShutdownHook] c.i.w.i.WebSocketServiceImpl.onClosing(496) : connection close 192.168.8.164
总结
到此这篇关于java逐行读取文件(读取文件每一行、按行读取文件)的文章就介绍到这了,更多相关java逐行读取文件内容请搜索脚本之家以前的文章或继续浏览下面的相关文章希望大家以后多多支持脚本之家!
相关文章
Spring项目中swagger用法与swagger-ui使用
这篇文章主要介绍了Spring项目中swagger用法与swagger-ui使用,通过图文并茂的形式给大家介绍了编写springboot项目的方法及导入spring-fox依赖的代码详解,需要的朋友可以参考下2021-05-05使用@Validated和@Valid 解决list校验的问题
这篇文章主要介绍了使用@Validated和@Valid 解决list校验的问题,具有很好的参考价值,希望对大家有所帮助。如有错误或未考虑完全的地方,望不吝赐教2021-10-10SpringBoot日志进阶实战之Logback配置经验和方法
本文给大家介绍在SpringBoot中使用Logback配置日志的经验和方法,并提供了详细的代码示例和解释,包括:滚动文件、异步日志记录、动态指定属性、日志级别、配置文件等常用功能,覆盖日常Logback配置开发90%的知识点,感兴趣的朋友跟随小编一起看看吧2023-06-06
最新评论