全部,解析Java中的日誌文件
我有一個包含以下內容的日誌文件。
Request from Centercord.
2010-12-14 12:42:13.724 [ 6796] ****************************
2010-12-14 12:42:13.724 [ 6796] 1111111111111111
2010-12-14 12:42:13.724 [ 6796]22222222222
Response from Centercord.
2010-12-14 12:42:21.802 [ 5960] 11111111111111
2010-12-14 12:42:21.802 [ 5960] ffffffffffffffffffffffffffff
2010-12-14 12:42:21.802 [ 5960] tttttttttttttttttttttttttttt
Request from Centercord.
2010-12-14 12:42:13.724 [ 6796] ****************************
我需要創建兩個日誌文件,一個是用於存儲所有的請求的細節,另一種是用於存儲所有響應的詳情。我如何解析這個並準備兩個日誌文件?
我需要下面的答案。
Log 1:
Request from Centercord.
2010-12-14 12:42:13.724 [ 6796] ****************************
2010-12-14 12:42:13.724 [ 6796] 1111111111111111
2010-12-14 12:42:13.724 [ 6796]22222222222
2010-12-14 12:42:13.724 [ 6796] ****************************
Log 2:
Response from Centercord.
2010-12-14 12:42:21.802 [ 5960] 11111111111111
2010-12-14 12:42:21.802 [ 5960] ffffffffffffffffffffffffffff
2010-12-14 12:42:21.802 [ 5960] tttttttttttttttttttttttttttt
問候, Kanagaraj
能否請您給我一些示例代碼? – user454894 2010-12-20 11:54:12