이 예제는 사용자 로그인을 읽고 참조 용 서버를 업로드하기위한 특정 구현 코드를 공유합니다. 특정 내용은 다음과 같습니다
클라이언트는 사용자에게 UNIX 서비스를 제공하는 서버에서 실행됩니다. 서버에서 사용자의 업스트림 및 다운 스트림 정보를 읽고 수집하는 데 사용하여 페어링하고 구성한 다음 요약을 위해 서버로 보내십시오.
특정 구현 코드 :
1. dmsserver.java
패키지 com.dms; import java.io.bufferedReader; import java.io.file; import java.io.fileoutputStream; import java.io.ioexception; import java.io.inputstreamreader; import java.io.outputStreamWriter; import java.io.printwriter; import java.net.net.suptockets; java.util.hashmap; import java.util.list; import java.util.map; import java.util.concurrent.blockingqueue; import java.util.concurrent.executorservice; import java.util.concurrent.executors; import java.util.concurent.concurent.concurent.concurnecutorervice; import org.dom4j.document; import org.dom4j.element; import org.dom4j.io.saxreader; /** * DMS Server, 각 클라이언트가 보낸 페어링 로그를 수신하고 로컬 파일에 저장 * @Author Administrator * */public class dmsServer {// serversOcket private serverSocket 서버를 클라이언트에 연결하는 데 사용되는 ServerSocket 서버; // 클라이언트 요청을 처리하는 스레드를 관리하는 데 사용되는 스레드 풀 (private executorService streadpool); // 클라이언트가 보낸 모든 파일 저장 개인 파일 ServerLogFile 로그를 페어링합니다. // 메시지 대기열 개인 블록 큐어 <문자열> MessageQueue = new LinkedBlockingqueue <string> (); public dmsserver ()는 예외 {try {system.out.println ( "서버가 초기화 ..."); // 1 구성 파일 Server-config.xml map <String, String> config = loadconfig (); // 2 속성 초기화 init (config); System.out.println ( "서버 초기화 완료 ..."); } catch (예외 e) {System.out.println ( "초기화 실패!"); e 던지기; }} / *** 생성자 메소드를 초기화하는 첫 번째 단계는 구성 파일을 구문 분석하는 것입니다* @return 반환 된 맵은 구성 파일의 각 항목에 저장됩니다. doc = reader.read (새 파일 ( "server-config.xml"); 요소 root = doc.getRootElement (); map <string, string> config = new Hashmap <String, String> (); /** <config> 태그*에서 모든 하위 태그를 가져 와서 각 하위 태그의 이름을 키로 저장하고 중간의* 텍스트는 맵 컬렉션의 값입니다*/ list <ementt> list = root.elements (); for (요소 e : list) {string key = e.getName (); 문자열 값 = e.getTextTrim (); config.put (키, 값); } 반환 구성; } catch (예외 e) {System.out.println ( "구성 파일 예외 해결!"); e.printstacktrace (); e 던지기; }} /** * 생성자 메소드를 초기화하는 두 번째 단계는 구성 항목 * @param config * @throws Exception * /private void init (map <string, string> config)에 따라 속성을 초기화하는 것입니다. 예외 { / * * 구성 파일에서 <logrecfile>을 초기화합니다. 고정 크기 스레드 풀이 생성되었습니다. 이 값은 구성 파일에서 <serverport>로 속성을 초기화합니다. 서버, 여기서이 값은 서버 serversocket*/ this.server = new serversocket (integer.parseint (config.get ( "serverport"))); this.serverlogfile = 새 파일 (config.get ( "logrecfile")); this.threadpool = executors.newfixedThreadpool (integer.parseint (config.get ( "threadsum"))); } /** * 서버에서 작업을 시작하는 메소드 * @throws 예외 * /public void start ()는 예외를 발생시킵니다. { / * * 구현 요구 사항 : * 먼저 스레드를 별도로 시작하여 SavelogHandler를 실행하십시오. *이 작업은 모든 페어링 로그를 저장 한 다음 서버 포트 루프를 듣기 시작합니다. 클라이언트가 연결되면 * ClientHander를 인스턴스화 한 다음 작업을 스레드 풀 *로 넘겨 클라이언트와의 상호 작용을 처리하기 위해 스레드를 할당하십시오. * */ try {System.out.println ( "서버가 작동하기 시작합니다 ..."); Saveloghandler SLH = New Saveloghandler (); 새 스레드 (slh) .start (); while (true) {Socket Socket = Server.accept (); ThreadPool.Execute (New ClientHandler (Socket)); }} catch (예외 e) {e.printstacktrace (); e 던지기; }} public static void main (String [] args) {try {dmsserver server = new dmsserver (); server.start (); } catch (예외 e) {System.out.println ( "스테이션이 서버를 시작하지 못했습니다!"); }}} / ** *이 스레드는 메시지 큐에서 각 페어링 된 각 로그를 가져오고 * @author 관리자 * / 개인 클래스 saveloghandler를 구현할 수있는 {public void run () {printwriter pw = null; try {pw = new printwriter (new FileOutputStream (ServerLogFile, True)); while (true) {if (messagequeue.size ()> 0) {pw.println (messagequeue.poll ()); } else {pw.flush (); Thread.sleep (500); }}} catch (예외 e) {e.printstacktrace (); } 마침내 {if (pw! = null) {pw.close (); }}}}} / ** * 지정된 클라이언트 요청 처리 * @Author Administrator * * / private Class ClientHandler는 실행 가능 {개인 소켓 소켓; public clienthandler (소켓 소켓) {this.socket = 소켓; } public void run () { / * * idea : * 먼저 클라이언트가 전송 한 모든 페어링 된 로그를 수신하고, "Over"까지 "Over"까지,이 페어링 된 * 로그를 로컬 파일에 저장하고, 클라이언트에 답장을 저장하고, "OK" * "OK" * 실행 단계 : * 1 : 클라이언트를 통해 응답을 보내기 위해 소켓을 통해 출력 스트림을 작성하십시오 * 2 : 클라이언트가 전송되는지 * 3 : * 각 줄을 읽습니다. 문자열 "Over"입니다. 그렇지 않은 경우 페어링 된 로그이며 로컬 파일에 저장하십시오. 그렇다면 * 읽기를 중지하십시오. * 4 : 모든 로그 */ printwriter pw = null을 성공적으로 읽은 후 클라이언트 "OK"에 회신하십시오. try {// 1 pw = new printwriter (new outputStreamWriter (socket.getOutputStream (), "utf-8")); // 2 bufferedReader br = new bufferedReader (new inputStreamReader (socket.getInputStream (), "utf-8")); // 3 문자열 메시지 = null; while ((message = br.readline ())! = null) {if ( "over".equals (message)) {break; } // 로그를 파일에 쓰기 위해 MessageQueue.offer (메시지)를 저장합니다. } // 4 pw.println ( "ok"); pw.flush (); } catch (예외 e) {e.printstacktrace (); pw.println ( "오류"); pw.flush (); } 마침내 {try {// 클라이언트에서 연결을 끊으려면 resource socket.close ()를 해제합니다. } catch (ioexception e) {e.printstacktrace (); }}}}}}}}}}}}}} 2. dmsclient.java
패키지 com.dms; import java.io.bufferedReader; import java.io.file; import java.io.ioexception; import java.io.inputStreamReader; import java.io.outputStreamwriter; import java.io.printwriter; import java.io.randomaccessfile; import java.net.socket; java.util.hashmap; import java.util.list; import java.util.map; import java.util.map.entry; import java.util.set; import org.dom4j.document; import org.dom4j.element; import org.dom4j.io.saxreader; import com.dms.bo.logdata; import com.dms.bo.logrec; /***이 클라이언트는 사용자에게 UNIX 서비스를 제공하는 서버에서 실행됩니다. * 서버에서 사용자의 업스트림 및 다운 스트림 정보를 읽고 수집하는 데 사용되었으며, * 페어링하여 정렬하여 서버로 보내 요약합니다. * @Author Administrator * */public class dmsclient {// 속성 정의 // 1 단계 : log // unix 시스템 로그 파일 개인 파일 로그 파일의 필요한 속성을 구문 분석합니다. // 구문 분석 된 로그 프라이버시 파일의 파일을 저장하십시오. TextLogFile; // 북마크 파일 개인 파일 LastPositionFile; // 각 구문 분석 로그 개인 int 배치에 대한 항목 수; // 2 단계 : 로그의 속성을 페어링합니다. // 파일 프리즈 파일을 저장합니다. logrecfile; // 파일을 저장 개인 파일을 저장합니다. loginLogFile; // 3 단계 : 로그의 속성을 구문 분석 // 서버 주소 private String serverHost; // 서버 포트 프라이빗 int 서버 포트; /*** 클라이언트를 초기화하는 데 사용되는 생성자 메소드* @Throws Exception*/public dmsclient ()는 예외를 던집니다 {try {// 1 구성 파일 config.xml map <string, string> config = loadconfig (); // Piling System.out.println (config); // 2 속성 초기화 init (config); } catch (예외 e) {System.out.println ( "초기화 실패!"); e 던지기; }} / ** * 생성자 메소드의 두 번째 단계를 초기화하고 구성 항목 * @param config * @throws Exception * / private void init (map <string, string> config)에 따라 속성을 초기화합니다. 예외 {try {logfile = new File ( "logfile")); textLogFile = 새 파일 (config.get ( "TextLogFile")); LastPositionFile = 새 파일 (config.get ( "lastPositionFile")); batch = integer.parseint (config.get ( "batch")); logrecfile = 새 파일 (config.get ( "logrecfile")); loginLogFile = 새 파일 (config.get ( "loginLogFile")); ServerHost = config.get ( "ServerHost"); serverport = integer.parseint (config.get ( "serverport")); } catch (예외 e) {System.out.println ( "초기화 속성 실패!"); e.printstacktrace (); e 던지기; }} / ** * 생성자 메소드의 초기화의 첫 번째 단계는 구성 파일 * @return 구성 파일의 각 항목에 저장된 구성 파일을 구문 분석하는 것입니다. 여기서 키 : 태그의 이름, * 값은 태그의 중간에있는 텍스트입니다. * @Throws 예외 <string, string> loadconfig () {saxreder excection {saxereder (); doc = reader.read (새 파일 ( "config.xml")); 요소 root = doc.getRootElement (); map <string, string> config = new Hashmap <String, String> (); /** <config> 태그*에서 모든 하위 태그를 가져 와서 각 하위 태그의 이름을 키로 사용하십시오.* 중간 텍스트의*는 맵 컬렉션에 값*/ list <ementire> list = root.elements ()로 저장됩니다. for (요소 e : list) {string key = e.getName (); 문자열 값 = e.getTextTrim (); config.put (키, 값); } 반환 구성; } catch (예외 e) {System.out.println ( "구문 분석 파일 예외!"); e.printstacktrace (); e 던지기; }} / *** 클라이언트가 작동을 시작하는 방법* 루프의 세 단계 :* 1 : 로그를 구문 분석* 2 : 로그 페어링* 3 : log* / public void start () {parselogs (); matchlogs (); sendLogs (); // while (true) {// parse log // if (! parselogs ()) {// 계속; // 계속; //} // pairing log /// if (! maysLogs ()) {// 계속; 실패* / private boolean sendlogs () { /** 구현 아이디어 :* logrecfile 파일의 모든 페어링 된 로그를 읽고 서버에 연결하고 서버를 보내면 서버를 모두 받으면 파일을 삭제할 수 있습니다. * 1 : logrecfile 파일이 존재해야합니다* 2 : 모든 페어링 된 로그를 컬렉션에 읽고 저장하십시오* 3 : 소켓을 통해 서버에 연결* 4 : 출력 스트림 생성* 4 : 5 : 라인에서 서버로 서버에 서버를 보내십시오* 6 : 모든 로그를 표시하기 위해* 8 : 응답을 읽었습니다. "OK"는 서버가 정상임을 의미합니다 * * 모든 로그를 수신 한 다음 LogRecFile * 파일을 삭제하고 반환 할 수 있습니다. * */ 소켓 소켓 = null; try {// 1 if (! logrecfile.exists ()) {System.out.println (logrecfile+"not resent!"); 거짓을 반환합니다. } // 2 list <string> matches = ioutil.loadlogrec (logrecfile); // 3 소켓 = 새로운 소켓 (ServerHost, ServerPort); // 4 printwriter pw = new PrintWriter (new outputStreamWriter (socket.getOutputStream (), "UTF-8"); // 5 for (문자열 로그 : matches) {pw.println (log); } // 6 pw.println ( "over"); pw.flush (); // 7 bufferedReader br = new bufferedReader (new inputStreamReader (socket.getInputStream (), "utf-8")); // 8 문자열 응답 = br.readline (); // 9 if ( "OK".Equals (응답)) {logrecfile.delete (); 진실을 반환하십시오. } else {System.out.println ( "보내지 실패!"); 거짓을 반환합니다. }} catch (예외 e) {System.out.println ( "로그 실패 보내기!"); e.printstacktrace (); } 마지막으로 {if (socket! = null) {try {socket.close (); } catch (ioexception e) {e.printstacktrace (); }} 거짓을 반환합니다. } /*** 2 단계 : log* @return true 쌍 : 성공적으로 페어링* 거짓 : 페어링 실패* /private boolean matchlogs () { /** 구현 아이디어 :* 마지막 쌍이 된 로그인 로그에서 첫 번째 단계에서 구문 분석 된 모든 새로운 로그를 읽은 다음, 동일한 pid, 하나는 7이고 다른 하나는 쌍을 맞추십시오. * 8 형을 찾을 수있는 한 *와 쌍을 이룰 수있는 로그인 로그를 찾을 수 있습니다. * * 구현 단계 : * 1 : 필요한 판단 * 1.1 : logrecfile이 존재하는지 여부. 그것이 존재하는 경우, 덮어 쓰기를 피하기 위해 더 이상 새로운 페어링 작업이 수행되지 않습니다. * 1.2 : TextLogFile 파일이 있어야합니다. * 2 : TextLogFile을 읽고 로그와 *를 컬렉션에 읽으십시오. (여러 LogData 인스턴스)* 3 : LoginLogFile 파일이 존재하는 경우, 마지막으로 성공적으로 짝을 이루지 않은 로그가 있으며, 컬렉션에도 함께 짝을 이루기 위해 컬렉션에 저장되어 있습니다* 4 : 페어링 작업* 4.1 : 모든 페어링 로그를 저장하기 위해 두 개의 맵을 생성하고 로그 아웃 로그를 저장합니다. 로그인 및 로그 아웃 * * 키 위치 : 사용자, pid * value : logdata 인스턴스 * 4.4 : 로그 아웃 맵을 가로 지르고 각 로그 아웃 로그의 키 *에 따라 로그인 맵에서 해당 로그인 로그인을 찾아서 페어링 된 로그를 페어링 된 로그 세트에 저장하십시오. 로그인 맵에서 페어링 된 로그*에서 로그인 로그를 삭제하십시오. 이런 식으로 ** 맵에 로그인 할 때만 페어링이 남아 있어야합니다. * 5 : logrecfile에 페어링 된 로그를 쓰십시오* 6 : waired 로그를 loginlogfile에 쓰기* 7 : textLogfile 파일을 삭제하십시오.* 8 : true가 완료되었음을 나타냅니다.*/try {// 1 //1.1 if (logrecfile.exists ()) {return true; } //1.2 if (! textLogFile.exists ()) {System.out.println (TextLogFile+"Not Event!"); 거짓을 반환합니다. } // 2 목록 <logdata> list = ioutil.loadLogData (TextLogFile); // 3 if (loginLogFile.exists ()) {list.addall (ioutil.loadLogData (loginLogFile)); } // 4 //4.1 목록 <logrec> matches = new Arraylist <logrec> (); //4.2지도 <문자열, logdata> loginmap = new Hashmap <String, logdata> (); Map <String, logdata> logoutmap = new Hashmap <String, logdata> (); //4.3 for (logdata logdata : list) {String key = logdata.getUser ()+ ","+ logdata.getPid (); if (logdata.getType () == logdata.type_login) {loginMap.put (key, logdata); } else if (logdata.getType () == logdata.type_logout) {logoutMap.put (key, logdata); }} //4.4 set <eptry <string, logdata >> entryset = logoutmap.entryset (); for (entry <string, logdata> e : entryset) {logdata logout = e.getValue (); logdata login = loginmap.remove (e.getkey ()); logrec logrec = new logrec (로그인, 로그 아웃); matches.add (logrec); } // 5 ioutil.saveCollection (일치, logrecfile); // 6 ioutil.saveCollection (loginMap.Values (), loginLogFile); // 7 textLogFile.Delete (); // 8 Return True; } catch (예외 e) {System.out.println ( "페어링 로그 실패!"); e.printstacktrace (); } false를 반환합니다. } /*** log* @return true : parse 성공 : false : parse 실패* /parse 실패* /private boolean parselogs () { /** 구현 아이디어 :* 루프 읽기 배치 로그, 그 다음 각 로그에서 5 개의 정보를 구문 분석하고 문자열을 형성하고,* 동작 단위로 텍스트를 형성하고,* 1 : extation to the that the that the that the that the that the that the that the that that the that that the that the that that the that the indection in* love 그러나 * 첫 번째 단계는 실행을 반복하여 이전 로그를 덮어 쓰고 여기에서 판단해야합니다. 구문 분석 로그*를 저장하면 로그 파일이 존재하며 첫 번째 단계는 더 이상 실행되지 않습니다. *이 로그 파일은 두 번째 단계가 페어링 된 후 삭제됩니다. * 1.2 : 로그 파일 파일이 존재해야합니다 (wtmpx 파일) * 1.3 : 여전히 구문 분석 할 수있는 로그가 있습니까 * 2 : 로그 파일을 읽기 위해 무작위 ACCESSFILE * 3 : 마지막 읽기 위치로 포인터를 이동하고, 새 구문 분석 작업을 준비 * 4.1 : 각 로그 인스턴스를 저장하기 위해 목록 모음을 만들기 * 4.2 : 루프 배치 * 4.2. 각 로그 (사용자, pid, type, time, host) *에서 logdata 인스턴스와 함께 저장 한 다음 * 로그다타 인스턴스를 컬렉션에 저장 * 5 : 동작 단위의 컬렉션의 모든 로그를 * TextLogfile * 6에 저장하십시오 * 6 : 작업이 완료되었음을 나타냅니다. */ randomaccessfile raf = null; {// 1 //1.1 if (textLogfile.exists ()) {return true; } //1.2 if (! logfile.exists ()) {System.out.println (logfile+"Not Event!"); 거짓을 반환합니다. } //1.3 long lastposition = haslogs (); // piling // system.out.println (// "lastPosition :"+lastPosition //); if (lastPosition <0) {System.out.println ( "로그를 구문 분석 할 수 없습니다!"); 거짓을 반환합니다. } // 2 RAF = 새로운 randomAccessFile (logfile, "r"); // 3 raf.seek (마지막 위치); // 4 목록 <logdata> list = new arraylist <logdata> (); for (int i = 0; i <batch; i ++) {// 각 구문 분석 전에 (logfile.length ()-마지막 위치 <logdata.log_length) {break; } // user raf.seek (lastPosition+logdata.user_offset); 문자열 user = ioutil.readstring (raf, logdata.user_length) .trim (); // PID RAF.SEEK (LastPosition+logdata.pid_offset); int pid = raf.readint (); // Parse type raf.seek (LastPosition+logdata.type_offset); 짧은 유형 = raf.readshort (); // 시간을 구문 분석 시간 raf.seek (lastPosition+logdata.time_offset); int time = raf.readint (); // 페이스트 호스트 RAF.seek (lastPosition+logdata.host_offset); 문자열 호스트 = ioutil.readstring (RAF, logdata.host_length) .trim (); logdata log = new logdata (사용자, PID, 유형, 시간, 호스트); list.add (log); // piling // system.out.println (log); // 로그를 업로드하고 최종 위치를 업데이트하고 lastposition = raf.getFilePointer (); } // 5 ioutil.saveCollection (list, textLogFile); // 6 북마크 파일 저장 ioutil.savelong (마지막 위치, 마지막 위치 파일); // 7 진실을 반환합니다. } catch (예외 e) {System.out.println ( "통과 로그 실패!"); e.printstacktrace (); } 마침내 {if (raf! = null) {try {raf.close (); } catch (ioexception e) {e.printstacktrace (); }} 거짓을 반환합니다. } /*** 첫 번째 단계는 로그에서 링크를 구문 분석하는 것입니다. * 북마크 파일 레코드의 위치에 따라, 여전히 구문 분석에 로그인이 있는지 확인하십시오. 있으면 마지막 위치*가 반환됩니다. 없는 경우 -1을 반환하십시오. * @return */ private long haslogs () {try {/ * * lastPositionFile이 존재하지 않으면 *가 구문 분석되지 않았으므로 처음부터 구문 분석 할 수 있습니다. } long lastposition = ioutil.readlong (lastPositionFile); if (logfile.length ()-마지막 위치> = logdata.log_length) {return lastposition; }} catch (예외 e) {e.printstacktrace (); } 반환 -1; } public static void main (String [] args) {try {dmsclient client = new dmsclient (); client.start (); } catch (예외 e) {System.out.println ( "클라이언트 실패!"); }}} 3. ioutil.java
패키지 com.dms; import java.io.bufferedReader; import java.io.file; import java.io.fileInputStream; import java.io.inputStreamReader; import java.io.printwriter; import java.io.randomaccessfile; import java.util.arraylist; import java.coplection; java. com.dms.bo.logdata; /** *이 클래스는 클라이언트 IO 운영을 담당하는 도구 클래스 * @Author Administrator */public class ioutil {/** * 주어진 파일에서 문자열의 각 줄을 읽고 (쌍 로그) * @Param 파일 * @return * @Throws 예외 */public static list> loadLogrec (파일 파일) 예외 {bubberdreaderedreaderedreaderedreaderedredreader; try {br = new bufferedReader (new inputStreamReader (new FileInputStream (file))); List <string> list = new ArrayList <string> (); 문자열 라인 = null; while ((line = br.readline ())! = null) {list.add (line); } 반환 목록; } catch (예외 e) {e.printstacktrace (); e 던지기; } 마침내 {if (br! = null) {br.close (); }}} /** * 주어진 파일에서 각 페어링 된 로그를 읽고 * 컬렉션에 저장 한 다음 반환합니다. * @param file * @return * @throws Exception */ public static list <logdata> loadlogdata (파일 파일) 예외 {bufferedReader br = null; try {br = new bufferedReader (new inputStreamReader (new FileInputStream (file))); 목록 <logdata> list = new arraylist <logdata> (); 문자열 라인 = null; while ((line = br.readline ())! = null) {logdata logdata = new logdata (line); list.add (logdata); } 반환 목록; } catch (예외 e) {e.printstacktrace (); e 던지기; } 마침내 {if (br! = null) {br.close (); }}} / ** * 지정된 긴 값을 주어진 파일의 첫 번째 줄에 문자열로 쓰십시오 * @param l * @param file * @throws Exception * / public static void savelong (long lon, 파일 파일) 예외 {printwriter pw = null; try {pw = new printwriter (파일); pw.println (lon); } catch (예외 e) {e.printstacktrace (); e 던지기; } 마침내 {if (pw! = null) {pw.close (); }}}} /*** 컬렉션의 각 요소의 ToString 메소드에 의해 리턴 된 문자열을 동작 단위의 지정된 파일에 쓰십시오. * @param c * @param 파일 * @Throws Exception */ public static void savecollection (collection c, file file)은 예외 {printwriter pw = null; try {pw = new printwriter (파일); for (object o : c) {pw.println (o); }} catch (예외 e) {e.printstacktrace (); e 던지기; } 마침내 {if (pw! = null) {pw.close (); }}} / ** * 주어진 randomAccessFile *의 현재 위치에서 연속적으로 시작하고 길이 바이트를 읽고 문자열로 변환하고 return * @param raf * @param 길이 * @return * @throws 예외 * / public static string readstring (randomAccesfile raf, int length) 예외 {byte [byte [length = new byte]]; raf.read (데이터); 새 문자열을 반환합니다 (데이터, "iso8859-1"); } catch (예외 e) {e.printstacktrace (); e 던지기; }} / ** * 주어진 파일에서 문자열의 첫 번째 줄을 읽은 다음 * return * @param 파일 * @Throws Exception * / public static long readlong (파일 파일) 예외 {bufferedReader br = null; try {br = new bufferedReader (new inputStreamReader (new FileInputStream (file))); 문자열 line = br.readline (); 반환 long.parselong (line); } catch (예외 e) {e.printstacktrace (); e 던지기; } 마침내 {if (br! = null) {br.close (); }}}}
4. config.xml
<? xml version = "1.0"encoding = "utf-8"?> <config> <!-Unix 시스템 로그 파일 이름-> <grogfile> wtmpx </logfile> <!-해결 된 로그 파일 이름을 저장-> <TextLogfile> log.txt </textLogfile> <!-<lastpoctionfile> lastplice> txt> txt> txt> txt> txt> txt> txt> <txtlogfile-> 구문 분석 된 로그 당 항목-> <batch> 10 </batch> <!-페어링 된 로그 파일 이름-> <logrecfile> logrec.txt </logrecfile> <!-ehoired log 파일 이름-> <loginlogfile> login.txt </loginlogfile> <!-loginlogfile-> loginlogfile>. <!-서버 주소-> <serverhost> localhost </serverhost> <!-서버 포트-> <serverport> 8088 </serverport> </config>
5. Server-config.xml
<? xml version = "1.0"encoding = "utf-8"?> <config> <!-페어링 된 로그 파일을 저장하는 서버의 파일 이름-> <logrecfile> server-logs.txt </logrecfile> <!-스레드 풀 스레드 수-> <thredsum> 30 </stroodsum> <server port-> <serverport> 808 </serverport>
위의 내용은이 기사에 관한 모든 것입니다. 모든 사람의 학습에 도움이되기를 바랍니다.