KR102189125B1 - System and method for collecting log - Google Patents

System and method for collecting log Download PDF

Info

Publication number
KR102189125B1
KR102189125B1 KR1020180152188A KR20180152188A KR102189125B1 KR 102189125 B1 KR102189125 B1 KR 102189125B1 KR 1020180152188 A KR1020180152188 A KR 1020180152188A KR 20180152188 A KR20180152188 A KR 20180152188A KR 102189125 B1 KR102189125 B1 KR 102189125B1
Authority
KR
South Korea
Prior art keywords
request
hooked
thread
information
servlet
Prior art date
Application number
KR1020180152188A
Other languages
Korean (ko)
Other versions
KR20200066427A (en
Inventor
박정환
진홍석
한혁
진성일
Original Assignee
주식회사 리얼타임테크
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 주식회사 리얼타임테크 filed Critical 주식회사 리얼타임테크
Priority to KR1020180152188A priority Critical patent/KR102189125B1/en
Publication of KR20200066427A publication Critical patent/KR20200066427A/en
Application granted granted Critical
Publication of KR102189125B1 publication Critical patent/KR102189125B1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/34Recording or statistical evaluation of computer activity, e.g. of down time, of input/output operation ; Recording or statistical evaluation of user activity, e.g. usability assessment
    • G06F11/3438Recording or statistical evaluation of computer activity, e.g. of down time, of input/output operation ; Recording or statistical evaluation of user activity, e.g. usability assessment monitoring of user actions
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/34Recording or statistical evaluation of computer activity, e.g. of down time, of input/output operation ; Recording or statistical evaluation of user activity, e.g. usability assessment
    • G06F11/3466Performance evaluation by tracing or monitoring
    • G06F11/3476Data logging

Landscapes

  • Engineering & Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Debugging And Monitoring (AREA)

Abstract

본 발명은 대용량으로 발생하는 로그들을 행위(Action)로 정의하여 정형화 된 형태로 처리하고, 행위들의 연속성을 룰로 정의하여 비정상적인 접근을 탐지하며, 인공지능 학습에 적합함과 아울러 고속으로 처리할 수 있는 행위 기반 룰 처리 장치 및 그 처리 방법을 제공하는 것을 목적으로 한다.
상기 목적을 달성하기 위해, 본 발명에 따른 로그 수집 시스템은, 복수의 사용자의 요청에 대한 응답을 수행하는 로그 수집 시스템으로서, 상기 요청에 대한 애플리케이션을 수행한 결과를 응답하기 위해 생성되는 스레드(Thread)와, 상기 스레드에 상기 사용자의 요청에 대한 정보를 저장하는 후킹된 서브릿(Servlet)과, 데이터베이스에 작업을 요청시, 상기 스레드를 이용하여 저장된 상기 요청에 대한 정보와 상기 데이터베이스에 요청한 작업에 대한 정보를 함께 저장하는 후킹된 데이터베이스 인터페이스(Database Interface)를 포함한다.
In the present invention, logs generated in a large amount are defined as actions and processed in a standardized form, and the continuity of actions is defined as a rule to detect abnormal access, suitable for artificial intelligence learning, and capable of processing at high speed. It is an object of the present invention to provide an action-based rule processing apparatus and a processing method thereof.
In order to achieve the above object, the log collection system according to the present invention is a log collection system that responds to requests from a plurality of users, and is created to respond to a result of executing an application for the request. ), and a hooked servlet that stores information on the user's request in the thread, and when requesting a job to the database, information on the request stored using the thread and the job requested to the database It includes a hooked database interface that stores information together.

Description

로그 수집 시스템 및 그 수집 방법{SYSTEM AND METHOD FOR COLLECTING LOG}Log collection system and its collection method {SYSTEM AND METHOD FOR COLLECTING LOG}

본 발명은 로그 수집 시스템 및 그 수집 방법에 관한 것으로, 더욱 상세하게는 소스 코드를 수정하거나 파일을 교체하지 않고 로드되는 클래스를 변조할 수 있는 로그 수집 시스템 및 그 수집 방법에 관한 것이다.The present invention relates to a log collection system and a method for collecting the same, and more particularly, to a log collection system capable of modulating a loaded class without modifying a source code or replacing a file, and a method of collecting the same.

일반적인 웹서버(Web Server)는 이미지나 HTML 파일과 같은 정적인 데이터를 처리하는 서버이다. 반면, 와스(WAS: Web Application Server)는 웹서버(정적 데이터 처리)와 웹컨테이너(동적 데이터 처리)가 합쳐진 서버로 정적인 데이터는 물론 동적인 데이터(jsp, asp, Servlet, php 등)를 처리하며, DB(데이터베이스)와 연결되어 데이터를 주고 받거나 프로그램으로 데이터 조작을 수행할 수 있다.A general web server is a server that processes static data such as images and HTML files. On the other hand, WAS (Web Application Server) is a server that combines a web server (static data processing) and a web container (dynamic data processing) and processes dynamic data (jsp, asp, Servlet, php, etc.) as well as static data. It is connected with a DB (database) to exchange data or perform data manipulation with a program.

즉, 초기 웹서버는 정적인 데이터만을 처리하였지만 점차 웹서버가 널리 사용되면서, 웹서버에서 데이터를 입력하고 조회하는 동적인 기능이 요구되었다. 이러한 요구에 부합하는 와스는 프로그램 실행 환경과 DB의 접속 기능을 제공하고, 복수의 트랜잭션을 관리하며, 업무를 처리하는 비지니스 로직을 수행한다.That is, the initial web server processed only static data, but as the web server was gradually used, a dynamic function of inputting and searching data in the web server was required. WAS, which meets these needs, provides a program execution environment and a DB connection function, manages multiple transactions, and executes business logic that processes tasks.

그런데, 이러한 와스에서 출력하는 Http Access 로그와, DB에서 출력하는 DB 로그는 하나의 사용자 행위에 의해 생성된다. 예를 들면, 사용자가 로그인 버튼을 클릭하면, Http Access 로그인 페이지에 접속하는 로그(Http Access 로그)와, DB의 사용자 테이블에서 생성되는 로그인 비교 로그(DB 로그)는 모두 하나의 사용자 행위에 의해 생성된다.By the way, the Http Access log output from WAS and the DB log output from DB are created by one user action. For example, when a user clicks the login button, both the log accessing the Http Access login page (Http Access log) and the login comparison log (DB log) created in the user table of the DB are generated by one user action. do.

하지만, Http Access 로그와, DB 로그는 각각 남겨지는 로그의 형태상 이를 한꺼번에 확인할 수 없는 문제점이 있었다. 즉, DB 로그와 짝을 이루는 Http Access 로그가 무엇인지 알 수 없는 문제점이 있었다.However, there was a problem that the Http Access log and the DB log could not be checked all at once due to the form of logs that are left respectively. In other words, there was a problem of not knowing what Http Access log is paired with the DB log.

이러한 문제점을 해결하기 위해서는 와스의 애플리케이션(사이트)에 직접적인 소스 코드 수정을 수행해야 하지만 이는 애플리케이션의 수많은 페이지 각각에 직접 소스 코드를 수정해야 하는 문제점이 있었다.In order to solve this problem, it is necessary to directly modify the source code in the application (site) of Was, but this has a problem in that the source code must be directly modified in each of the numerous pages of the application.

게다가, 이러한 애플리케이션의 소스 코드 수정은 보안상 타사에 위탁(委託)할 수 없으며, 이 애플리케이션을 운용하는 운용사의 입장에서는 이러한 소스 코드의 수정에 인력과, 비용을 소비할 수 없는 문제점이 있었다.In addition, modification of the source code of such an application cannot be entrusted to a third party for security reasons, and there is a problem that the manager who operates this application cannot consume manpower and cost to modify the source code.

이에 본 발명은 상기한 바와 같은 요구에 부응하기 위해 제안된 것으로서, 그 목적은 클래스 로더가 클래스의 바이너리를 보내기 이전에 바이너리 상태에서의 바이트 코드의 수정을 통해 애플리케이션의 소스 코드를 수정하거나 파일의 교체하지 않고 로드되는 클래스를 변조할 수 있는 로그 수집 시스템 및 그 수집 방법을 제공하는 것이다.Accordingly, the present invention has been proposed to meet the above requirements, and its purpose is to modify the source code of the application or replace the file by modifying the byte code in the binary state before the class loader sends the binary of the class. It is to provide a log collection system and a method of collecting the log that can tamper with the class loaded without doing so.

상기 목적을 달성하기 위해, 본 발명에 따른 로그 수집 시스템은, 복수의 사용자의 요청에 대한 응답을 수행하는 로그 수집 시스템으로서, 상기 요청에 대한 애플리케이션을 수행한 결과를 응답하기 위해 생성되는 스레드(Thread)와, 상기 스레드에 상기 사용자의 요청에 대한 정보를 저장하는 후킹된 서브릿(Servlet)과, 데이터베이스에 작업을 요청시, 상기 스레드를 이용하여 저장된 상기 요청에 대한 정보와 상기 데이터베이스에 요청한 작업에 대한 정보를 함께 저장하는 후킹된 데이터베이스 인터페이스(Database Interface)를 포함한다.In order to achieve the above object, the log collection system according to the present invention is a log collection system that responds to requests from a plurality of users, and is created to respond to a result of executing an application for the request. ), and a hooked servlet that stores information on the user's request in the thread, and when requesting a job to the database, information on the request stored using the thread and the job requested to the database It includes a hooked database interface that stores information together.

또한, 본 발명에 따른 로그 수집 시스템에서, 상기 스레드는 상기 사용자의 요청에 대해 각각의 TLS(Thread Local Storage)를 가지며, 상기 후킹된 서블릿은 상기 TLS에 상기 요청에 대한 정보를 저장한다.In addition, in the log collection system according to the present invention, the thread has each TLS (Thread Local Storage) for the user's request, and the hooked servlet stores information about the request in the TLS.

또한, 본 발명에 따른 로그 수집 시스템에서, 상기 후킹된 데이터베이스 인터페이스는 해당하는 상기 스레드의 TLS에 접근하여 상기 요청에 대한 정보를 불러드려 상기 데이터베이스에 요청한 정보를 함께 저장한다.In addition, in the log collection system according to the present invention, the hooked database interface accesses the TLS of the corresponding thread, fetches information on the request, and stores the requested information in the database together.

한편, 상기 목적을 달성하기 위해, 본 발명에 따른 로그 수집 방법은, 복수의 사용자의 요청에 대한 응답을 수행하는 로그 수집 방법으로서, 복수의 사용자의 요청을 와스(WAS:Web Application Server)에 각각 전달하는 제 1 단계(S10)와, 상기 와스가 스레드를 생성하여 상기 요청에 해당하는 후킹된 서블릿을 실행하는 제 2 단계(S20)와, 상기 후킹된 서블릿에 의해 상기 스레드에 상기 사용자의 요청에 대한 정보를 저장하는 제 3 단계(S30)와, 상기 후킹된 서블릿의 애플리케이션이 동작 중 상기 요청에 따라 필요시, 후킹된 데이터베이스 인터페이스를 통해 데이터베이스에게 작업을 요청하는 제 4 단계(S40)와, 상기 후킹된 데이터베이스 인터페이스에서 상기 스레드를 이용하여 저장된 상기 요청에 대한 정보와 상기 데이터베이스에 요청한 작업에 대한 정보를 함께 저장하는 제 5 단계(S50)를 포함한다.Meanwhile, in order to achieve the above object, the log collection method according to the present invention is a log collection method that responds to a request of a plurality of users, and requests from a plurality of users are respectively sent to a WAS (Web Application Server). The first step (S10) of transmitting, the second step (S20) of executing the hooked servlet corresponding to the request by creating a thread by the WASS, and the hooked servlet to the thread in response to the user's request A third step (S30) of storing information about the hooked servlet, and a fourth step (S40) of requesting a job from the database through a hooked database interface if necessary according to the request while the application of the hooked servlet is operating, and the And a fifth step (S50) of storing the information on the request stored using the thread in the hooked database interface and information on the job requested in the database.

또한, 본 발명에 따른 로그 수집 방법에서, 상기 스레드는 상기 사용자의 각각의 요청에 대해 각각의 TLS(Thread Local Storage)를 가지며, 상기 후킹된 서블릿은 상기 TLS에 상기 요청에 대한 정보를 저장한다.In addition, in the log collection method according to the present invention, the thread has each TLS (Thread Local Storage) for each request of the user, and the hooked servlet stores information about the request in the TLS.

또한, 본 발명에 따른 로그 수집 방법에서, 상기 후킹된 데이터베이스 인터페이스는 해당하는 상기 스레드의 TLS에 접근하여 상기 요청에 대한 정보를 불러드려 상기 데이터베이스에 요청한 정보를 함께 저장한다.In addition, in the log collection method according to the present invention, the hooked database interface accesses the TLS of the corresponding thread, fetches information on the request, and stores the requested information in the database together.

본 발명에 의하면, 클래스 로더가 클래스의 바이너리를 보내기 이전에 바이너리 상태에서의 바이트 코드의 수정을 통해 애플리케이션의 소스 코드를 수정하거나 파일의 교체하지 않고 로드되는 클래스를 변조할 수 있는 효과가 있다.According to the present invention, before the class loader sends the binary of the class, it is possible to modify the source code of the application by modifying the byte code in the binary state or modulate the loaded class without replacing the file.

도 1은 본 발명에 따른 로그 수집 시스템의 전체 구성을 나타내는 시스템 구성도.
도 2는 본 발명에 따른 로그 수집 시스템에서 클래스 로더의 구조를 나타내는 도면.
도 3은 본 발명에 따른 로그 수집 시스템에서 클래스 로더의 처리 상태를 나타내는 도면.
도 4는 본 발명에 따른 로그 수집 시스템의 처리 상태를 나타내는 도면.
1 is a system configuration diagram showing the overall configuration of a log collection system according to the present invention.
2 is a diagram showing the structure of a class loader in the log collection system according to the present invention.
3 is a view showing a processing state of a class loader in the log collection system according to the present invention.
4 is a view showing a processing state of the log collection system according to the present invention.

이하, 본 발명의 실시예에 대해 관련 도면들을 참조하여 상세히 설명하기로 한다.Hereinafter, embodiments of the present invention will be described in detail with reference to the related drawings.

도 1은 본 발명에 따른 로그 수집 시스템의 전체 구성을 나타내는 시스템 구성도이다.1 is a system configuration diagram showing the overall configuration of a log collection system according to the present invention.

도 1을 참조하면, 본 발명에 따른 로그 수집 시스템(1000)은 복수의 사용자(10)의 요청에 대한 응답을 수행하는 로그 수집 시스템(1000)이다. 이러한 로그 수집 시스템(1000)은 스레드(Thread : 110)와, 후킹된 서브릿(Hooked Servlet : 122)과, 후킹된 데이터베이스 인터페이스(Hooked Database Interface : 130)를 갖는 와스(Web Application Server : 100)와, 데이터베이스(200)를 포함한다.Referring to FIG. 1, the log collection system 1000 according to the present invention is a log collection system 1000 that responds to requests from a plurality of users 10. The log collection system 1000 includes a thread (Thread: 110), a hooked servlet (122), and a WASS (Web Application Server: 100) having a hooked database interface (Hooked Database Interface: 130), Includes database 200.

일반적으로, 스레드(110)는 컴퓨터 프로그램 수행시 프로세스 내부에 존재하는 수행 경로, 즉 일련의 실행 코드로, 실제 작업을 담당한다. 프로세스 생성시 하나의 주 스레드가 생성되어 대부분의 작업을 처리하고, 주 스레드가 종료되면 프로세스도 종료된다. 하나의 운영 체계에서 여러 개의 프로세스가 동시에 실행되는 환경이 멀티태스킹이고, 하나의 프로세스 내에서 다수의 스레드가 동시에 수행되는 것이 멀티스레딩이다. 본 발명에서는 이러한 스레드가 복수의 사용자(10)의 요청에 대한 애플리케이션(121)을 수행한 결과를 응답하기 위해 생성된다. 이러한 스레드(110)는 와스(100) 내부에서 와스(100)와 통신한다. 또한, 이러한 스레드(110)는 복수의 사용자(10)에 따라 복수의 스레드(110)가 각각 형성된다. 즉, 복수의 사용자(10)가 100개일 경우, 100개의 사용자(10)에게 각각 1개씩 100개의 스레드(110)가 생성된다.In general, the thread 110 is an execution path that exists inside a process when a computer program is executed, that is, a series of execution codes, and is in charge of actual work. When creating a process, one main thread is created to handle most of the work, and when the main thread is terminated, the process is also terminated. Multitasking is an environment in which multiple processes are executed simultaneously in one operating system, and multithreading is when multiple threads are simultaneously executed in one process. In the present invention, such a thread is created to respond to a result of executing the application 121 to the request of the plurality of users 10. These threads 110 communicate with the washers 100 within the washers 100. In addition, in the thread 110, a plurality of threads 110 are formed according to a plurality of users 10, respectively. That is, when the number of users 10 is 100, 100 threads 110 are generated, one for each of 100 users 10.

후킹된 서블릿(122)은 스레드(110)에 사용자(10)의 요청에 대한 정보를 저장하는 역할을 수행한다. 사용자(10)가 와스(100)에 자원 정보(예를 들면, 페이지 정보나, 로그인 정보, 애플리케이션 정보 등)를 요청하면, 일반적인 서브릿(120)은 스레드(110)에 상기 요청에 대한 정보를 저장한다. 또한, 필요시 데이터베이스(200)에 저장되어 있는 데이터베이스 정보들을 불러드린다. 이때, 데이터베이스 로그(query) 들이 일반적인 서블릿의 어느 액세스 로그(Access Log)와 매칭되는 것인지, 즉 어느 사용자(10)의 요청에 의해 수행되는 것인지 알 수 없고, 이를 해결하기 위해서는 애플리케이션(121)의 수정을 통해 애플리케이션(121)이 액세스 로그와, 데이터베이스 로그를 매칭시켜서 하나의 애플리케잉션 로그로 생성해야만 한다. 하지만, 본 발명에 따른 로그 수집 시스템(1000)에서는 스레드(110)가 사용자(10) 요청에 대해 각각의 TLS(Thread Local Storage)를 가지며, 후킹된 서브릿(122)은 이러한 스레드(110)의 TLS에 사용자(10)의 요청에 대한 정보를 저장한다. 여기서, TLS란 스레드(10)가 각각 가지게 되는 독립 공간이다.The hooked servlet 122 serves to store information on the request of the user 10 in the thread 110. When the user 10 requests resource information (for example, page information, login information, application information, etc.) to the wash 100, the general servlet 120 stores the information on the request in the thread 110 do. In addition, database information stored in the database 200 is called when necessary. At this time, it is not known which access log of the general servlet is matched, that is, which user 10 requests, and to solve this problem, the application 121 is modified. Through the application 121, the access log and the database log must be matched to generate one application log. However, in the log collection system 1000 according to the present invention, the thread 110 has each TLS (Thread Local Storage) for the user 10 request, and the hooked servlet 122 is the TLS of the thread 110 To store information on the request of the user 10. Here, TLS is an independent space each thread 10 has.

또한, 후킹된 데이터베이스 인터페이스(130)는 후킹된 서브릿(122)이 데이터베이스(200)에 작업을 요청시, 스레드(110)를 이용하여 저장된 상기 사용자(10)의 요청에 대한 정보와, 데이터베이스(200)에 요청한 작업에 대한 정보를 함께 스레드(110)에 저장한다. 즉, 후킹된 서블릿(122)은 스레드(122)가 생성한 TLS에 사용자(10)의 요청에 대한 정보를 저장하고, 데이터베이스(200)의 정보가 필요한 경우, 후킹된 데이터베이스 인터페이스(130)는 후킹된 서블릿(122)에 요청한 사용자(10)에 해당하는 스레드(110)의 TLS에 접근하여 상기 사용자(10)의 요청에 대한 정보를 불러드려 데이터베이스(200)에 요청한 정보를 함께 저장한다. 이에 의해, 복수의 사용자(10) 중 하나의 사용자(10)에 의해 생성되는 하나의 스레드(110)의 TLS에, 후킹된 서블릿(122)이 저장하는 사용자(10)의 요청에 대한 정보와, 후킹된 데이터베이스 인터페이스(130)가 데이터베이스(200)에 요청한 정보가 함께 저장됨으로써, 일반적인 와스(100)에서 애플리케이션의 수정을 통해 액세스 로그의 내용과 데이터베이스 로그의 내용의 매칭을 수행하지 않고, 후킹을 통해 실제 해당 모듈이 동작할 때, 후킹된 서브릿(122)과, 후킹된 데이터베이스 인터페이스(130)을 감지하여 기록하게 된다. 즉, 스레드(110)의 TLS에 스레드(110)를 키(key)값으로 하여, 사용자(10)의 요청 정보를 저장하고, 이후 후킹된 데이터베이스 인터페이스(130)에서 상기 스레드(110) 정보를 가지고 TLS에서 사용자(10)의 요청 정보를 불러드려 데이터베이스의 쿼리(query) 정보와 함께 로깅하게 된다.In addition, when the hooked servlet 122 requests a job to the database 200, the hooked database interface 130 includes information on the request of the user 10 stored using the thread 110 and the database 200. ) And stores the information on the task requested in the thread 110 together. That is, the hooked servlet 122 stores information on the request of the user 10 in the TLS generated by the thread 122, and when the information of the database 200 is required, the hooked database interface 130 is hooked. The requested information is stored in the database 200 by accessing the TLS of the thread 110 corresponding to the user 10 making the request to the servlet 122, calling information on the request of the user 10, and storing the requested information in the database 200. Accordingly, information on the request of the user 10 stored by the hooked servlet 122 in TLS of one thread 110 generated by one user 10 among the plurality of users 10, and Since the information requested by the hooked database interface 130 is stored together with the database 200, the contents of the access log and the contents of the database log are not matched by modifying the application in the general wash 100, but through hooking. When the module actually operates, the hooked servlet 122 and the hooked database interface 130 are detected and recorded. That is, by using the thread 110 as a key value in the TLS of the thread 110, the request information of the user 10 is stored, and then the thread 110 information is stored in the hooked database interface 130. In TLS, the request information of the user 10 is called and logged together with the query information of the database.

이러한 TLS는 스레드(110)가 각각 가지게 되는 독립 공간으로, 사용자(10)가 와스(100)에 요청을 하게 되면, 반드시 하나의 스레드(110)를 할당받아 동작하기 때문에, 초반 후킹 과정에서 후킹된 서브릿(122)이 TLS에 요청 정보를 저장하게 된다. 그후, HttpAccess나 데이터베이스 인터페이스 접근과 같은 로그 대상의 메서드(함수)가 호출되면 TLS에 저장된 요청 정보와 맵핑하여 로그로 남기게 된다.This TLS is an independent space each thread 110 has, and when the user 10 makes a request to the wash 100, one thread 110 must be allocated and operated, so that the hooked in the initial hooking process The servlet 122 stores the request information in TLS. After that, when a log target method (function) such as HttpAccess or database interface access is called, it is mapped with the request information stored in TLS and recorded as a log.

도 2는 본 발명에 따른 로그 수집 시스템에서 클래스 로더의 구조를 나타내는 도면이다.2 is a diagram showing the structure of a class loader in the log collection system according to the present invention.

도 2를 참조하면, 본 발명에 따른 로그 수집 시스템(1000)에서는 애플리케이션(121)의 수정이나 파일의 교체 없이 로드되는 클래스를 변조할 수 있다. 기본적인 클래스 로더의 구조는 Jar File 또는 단일 Class File(1)의 바이트 배열인 바이너리(3)를 JVM(Java Virtual Machine : 4)에게 넘겨주어 클래스 로딩을 하는 구조이다. 여기서, 클래스 로더(Class Loader)란 다음과 같다. 자바는 클래스라는 파일로 프로그램이 구성되며, 이러한 클래스를 읽어오는 모듈을 클래스 로더라 하고, 기본적으로 클래스 로더는 JVM에 기본적으로 탑재되어 있다.Referring to FIG. 2, in the log collection system 1000 according to the present invention, it is possible to modulate a class loaded without modifying the application 121 or replacing a file. The basic class loader structure is a structure for class loading by passing the binary (3), which is a byte array of a jar file or a single class file (1), to the JVM (Java Virtual Machine: 4). Here, the class loader is as follows. In Java, a program is composed of a file called a class, and the module that reads these classes is called a class loader, and the class loader is basically installed in the JVM.

본 발명에서 후킹을 수행하는 후킹 모듈의 클래스 로더(2)는 JVM(4)에게 바이너리를 주기 직전, 바이너리(3) 상태에서의 바이트 코드(어셈블리와 같은 역할) 수정을 통해, 실제 애플리케이션(121)의 소스 코드 수정이나 파일 교체 없이 로드 되는 클래스를 변조할 수 있다.In the present invention, the class loader 2 of the hooking module performing hooking is performed by modifying the byte code (role like an assembly) in the binary 3 state just before giving the binary to the JVM 4, the actual application 121 The loaded class can be altered without modifying the source code of the file or replacing the file.

도 3은 본 발명에 따른 로그 수집 시스템에서 클래스 로더의 처리 상태를 나타내는 도면이다.3 is a diagram showing a processing state of a class loader in the log collection system according to the present invention.

일반적인 와스(100)의 기본 부팅 과정은 JVM(4)의 클래스 로더가 와스(100)의 최초 실행을 담당하는 Jar File을 로드하여 실행하고, 해당 와스(100)의 Jar File은 코어 클래스와 와스(100)의 커스텀 클래스 로더를 로드하게 된다. 그후 커스텀 클래스 로더가 애플리케이션(예를 들면, 사이트 등), 플러그인(JDBC, Graphic Library) 들을 로드하며 와스(100)가 동작한다. 즉, 와스(100)의 기본적인 부팅 과정에서, JVM(4)의 클래스 로더가 와스(100)의 최초 실행 Jar File(1)을 로드하여 실행하고, 해당 와스(100)의 Jar File(1)은 코어 클래스와, 와스(100)의 커스텀 클래스 로더를 로딩(7)하게 된다. 그후, 커스텀 클래스 로더가 애플리케이션(사이트), 플러그인(JDBC, Graphic Library) 들을 로드(9)하며 와스(100)가 동작한다.In the basic booting process of the general Was (100), the class loader of the JVM (4) loads and executes the Jar File responsible for the initial execution of the Was (100), and the Jar File of the Was (100) is the core class and the 100)'s custom class loader is loaded. After that, the custom class loader loads applications (eg, sites, etc.) and plug-ins (JDBC, Graphic Library), and the WAS 100 operates. That is, in the basic booting process of the Was (100), the class loader of the JVM (4) loads and executes the first execution Jar File (1) of the Was (100), and the Jar File (1) of the Was (100) is The core class and the custom class loader of the WAS 100 are loaded (7). After that, the custom class loader loads 9 applications (sites) and plug-ins (JDBC, Graphic Library), and the WAS 100 operates.

하지만, 도 3에 나타낸 바와 같이, 본 발명에 따른 로그 수집 시스템(1000)에서는, 와스(100)에 직접적인 수정없이 후킹 모듈을 이용하여 실행하게 된다. 클래스 로더(5)는 부모 클래스 로더를 이용하는 메커니즘을 가진다. 즉, 하위 클래스 로더는 상위 클래스 로더를 이용하게 된다. 이에 의거하여, 후킹 모듈의 클래스 로더를 통해 와스(100)를 실행하여 와스(100)의 기본 클래스 로더를 후킹 모듈의 클래스 로더(5)가 되도록 하고, 와스(100) 내부적으로 사용되는 커스텀 클래스 로더(7)를 바이트 코드 패칭을 통해 후킹 클래스 로더로서 동작하도록 한다. 이에 의해 와스(100)가 로딩하는 애플리케이션과, 플러그 인(JDBC, Graphic Library : 9)들을 런타임 중간(실행 중간)에 수정할 수 있다.However, as shown in FIG. 3, in the log collection system 1000 according to the present invention, the washer 100 is executed using a hooking module without direct modification. The class loader 5 has a mechanism using a parent class loader. That is, the lower class loader uses the upper class loader. Based on this, the Was 100 is executed through the class loader of the hooking module so that the base class loader of the Was 100 becomes the class loader 5 of the hooking module, and the Was 100 is a custom class loader used internally. (7) Operates as a hooking class loader through byte code patching. Accordingly, applications and plug-ins (JDBC, Graphic Library: 9) loaded by the WAS 100 can be modified in the middle of the runtime (in the middle of execution).

도 4는 본 발명에 따른 로그 수집 시스템의 처리 상태를 나타내는 도면이다.4 is a diagram showing a processing state of the log collection system according to the present invention.

본 발명에 따른 로그 수집 방법은 총 5개의 단계에 의해 수행된다.The log collection method according to the present invention is performed by a total of five steps.

복수의 사용자(10)의 요청에 대한 응답을 수행하는 로그 수집 방법으로서, 제 1 단계(S10)에서는, 복수의 사용자(10)의 각각의 요청을 복수의 스레드(110)를 통해 와스(100)에 각각 전달한다. 즉, 1개의 사용자(10)의 요청을 1개의 스레드(110)를 통해 와스(100)에 전달되므로, 예를 들어 100개의 사용자(10)의 각각의 요청이 와스(100)에 전달되기 위해서는 100개의 스레드(110)가 생성된다. 이때, 스레드(110)는 사용자(10)의 각각의 요청에 대해 각각의 TLS(Thread Local Storage)를 가진다.As a log collection method for performing a response to a request of a plurality of users 10, in a first step (S10), each request of the plurality of users 10 is transmitted through a plurality of threads 110, To each pass. That is, since the request of one user 10 is transmitted to the washout 100 through one thread 110, for example, in order for each request of the 100 users 10 to be transferred to the washout 100, 100 Three threads 110 are created. At this time, the thread 110 has each TLS (Thread Local Storage) for each request of the user 10.

제 2 단계(S20)에서는, 와스(100)가 스레드(110)를 생성하여 사용자(10)의 요청에 해당하는 후킹된 서블릿(122)을 실행한다.In the second step (S20), the washer 100 creates the thread 110 to execute the hooked servlet 122 corresponding to the request of the user 10.

또한, 제 3 단계(S30)에서는 후킹된 서블릿(122)에 의해 스레드(110)의 TLS에 사용자(10)의 요청에 대한 정보를 저장한다. 즉, 후킹된 서블릿(122)은 TLS에 요청에 대한 정보를 저장한다.In addition, in the third step (S30), information on the request of the user 10 is stored in the TLS of the thread 110 by the hooked servlet 122. That is, the hooked servlet 122 stores information about the request in TLS.

제 4 단계(S40)에서는 후킹된 서블릿(122)의 애플리케이션(121)이 동작 중 요청에 따라 필요시, 후킹된 데이터베이스 인터페이스(130)를 통해 데이터베이스(200)에게 작업을 요청한다.In the fourth step (S40), the application 121 of the hooked servlet 122 requests a job from the database 200 through the hooked database interface 130 when necessary according to a request during operation.

제 5 단계(S50)에서는 후킹된 데이터베이스 인터페이스(130)에서 스레드(110)의 TLS를 이용하여 저장된 사용자(10)의 요청에 대한 정보와 데이터베이스(200)에 요청한 작업에 대한 정보를 함께 저장한다. 즉, 후킹된 데이터베이스 인터페이스(130)는 해당하는 스레드(110)의 TLS에 접근하여 상기 요청에 대한 정보를 불러드려 상기 데이터베이스에 요청한 정보를 함께 저장한다.In the fifth step (S50), information on the request of the user 10 and the information on the job requested to the database 200 are stored together with the information on the request of the user 10 stored using TLS of the thread 110 in the hooked database interface 130. That is, the hooked database interface 130 accesses the TLS of the corresponding thread 110, calls the information on the request, and stores the requested information in the database together.

이러한 TLS는 스레드(110)가 각각 가지게 되는 독립 공간으로, 사용자(10)가 와스(100)에 요청을 하게 되면, 반드시 하나의 스레드(110)를 할당받아 동작하기 때문에, 초반 후킹 과정에서 후킹된 서브릿(122)이 TLS에 요청 정보를 저장하게 된다. 그후, HttpAccess나 데이터베이스 인터페이스 접근과 같은 로그 대상의 메서드(함수)가 호출되면 TLS에 저장된 요청 정보와 맵핑하여 로그로 남기게 된다.This TLS is an independent space each thread 110 has, and when the user 10 makes a request to the wash 100, one thread 110 must be allocated and operated, so that the hooked in the initial hooking process The servlet 122 stores the request information in TLS. After that, when a log target method (function) such as HttpAccess or database interface access is called, it is mapped with the request information stored in TLS and recorded as a log.

즉, 본 발명에 따른 로그 수집 시스템(1000)은 스레드(110)의 TLS를 활용하여, TLS에 (Key : Thread, Value : Request) 구조로 저장한다. 이에 의해, 사용자(10)의 요청에 대한 액세스 로그가 생성된다. 이후, 사용자(10)의 스레드 정보를 key 값으로 TLS를 검색하고, 사용자(10)의 요청 정보와 같이 데이터베이스 로그(query)를 로깅 인터페이스(Logging Interface)로 전달하게 된다.That is, the log collection system 1000 according to the present invention utilizes the TLS of the thread 110 and stores it in the TLS structure in a (Key: Thread, Value: Request) structure. Accordingly, an access log for the request of the user 10 is generated. Thereafter, TLS is searched using the thread information of the user 10 as a key value, and a database log is transmitted to the logging interface, as in the request information of the user 10.

이상의 설명은 본 발명의 기술 사상을 예시적으로 설명한 것에 불과한 것으로서, 본 발명이 속하는 기술 분야에서 통상의 지식을 가진 자라면 본 발명의 본질적인 특성에서 벗어나지 않는 범위에서 다양한 수정 및 변형이 가능할 것이다. 따라서, 본 발명에 개시된 실시예들은 본 발명의 기술 사상을 한정하기 위한 것이 아니라 설명하기 위한 것이고, 이러한 실시예에 의하여 본 발명의 기술 사상의 범위가 한정되는 것은 아니다. 본 발명의 보호범위는 아래의 청구범위에 의하여 해석되어야 하며, 그와 동등한 범위 내에 있는 모든 기술 사상은 본 발명의 권리범위에 포함되는 것으로 해석되어야 할 것이다.The above description is merely illustrative of the technical idea of the present invention, and those of ordinary skill in the art to which the present invention pertains will be able to make various modifications and variations without departing from the essential characteristics of the present invention. Accordingly, the embodiments disclosed in the present invention are not intended to limit the technical idea of the present invention, but to explain the technical idea, and the scope of the technical idea of the present invention is not limited by these embodiments. The scope of protection of the present invention should be interpreted by the following claims, and all technical ideas within the scope equivalent thereto should be construed as being included in the scope of the present invention.

10 : 사용자
100 : 와스
110 : 스레드
120 : 서블릿
121 : 애플리케이션
122 : 후킹된 서블릿
130 : 후킹된 데이터베이스 인터페이스
200 : 데이터베이스
1000 : 로그 수집 시스템
10: user
100: was
110: thread
120: servlet
121: application
122: hooked servlet
130: hooked database interface
200: database
1000: log collection system

Claims (6)

복수의 사용자의 요청에 대한 응답을 수행하는 로그 수집 시스템으로서,
상기 요청에 대한 애플리케이션을 수행한 결과를 응답하기 위해 생성되는 스레드(Thread)와,
상기 스레드에 상기 사용자의 요청에 대한 정보를 저장하는 후킹된 서브릿(Servlet)과,
데이터베이스에 작업을 요청시, 상기 스레드를 이용하여 저장된 상기 요청에 대한 정보와 상기 데이터베이스에 요청한 작업에 대한 정보를 함께 저장하는 후킹된 데이터베이스 인터페이스(Database Interface)를 포함하며,
상기 후킹된 서브릿의 클래스 로더를 통해 와스(WAS)를 실행하여 상기 와스의 기본 클래스 로더를 상기 후킹된 서브릿의 클래스 로더가 되도록 하고,
상기 와스에서 사용되는 커스텀 클래스 로더를 바이트 코드 패칭을 통해 후킹 클래스 로더로서 동작하도록 하는 로그 수집 시스템.
As a log collection system that responds to requests from multiple users,
A thread created to respond to the result of executing the application for the request, and
A hooked servlet that stores information on the user's request in the thread,
When requesting a job to a database, it includes a hooked database interface that stores information on the request stored using the thread and information on the job requested in the database together,
Execute WAS through the class loader of the hooked servlet to make the base class loader of the Was the class loader of the hooked servlet,
A log collection system that enables the custom class loader used in the WAS to operate as a hooking class loader through byte code patching.
제 1 항에 있어서,
상기 스레드는 상기 사용자의 요청에 대해 각각의 TLS(Thread Local Storage)를 가지며,
상기 후킹된 서블릿은 상기 TLS에 상기 요청에 대한 정보를 저장하는 로그 수집 시스템.
The method of claim 1,
The thread has each TLS (Thread Local Storage) for the user's request,
The hooked servlet is a log collection system that stores information on the request in the TLS.
제 2 항에 있어서,
상기 후킹된 데이터베이스 인터페이스는 해당하는 상기 스레드의 TLS에 접근하여 상기 요청에 대한 정보를 불러드려 상기 데이터베이스에 요청한 정보를 함께 저장하는 로그 수집 시스템.
The method of claim 2,
The hooked database interface accesses the TLS of a corresponding thread, calls information on the request, and stores the requested information in the database together.
복수의 사용자의 요청에 대한 응답을 수행하는 로그 수집 방법으로서,
복수의 사용자의 요청을 와스(WAS:Web Application Server)에 각각 전달하는 제 1 단계(S10)와,
상기 와스가 스레드를 생성하여 상기 요청에 해당하는 후킹된 서블릿을 실행하는 제 2 단계(S20)와,
상기 후킹된 서블릿에 의해 상기 스레드에 상기 사용자의 요청에 대한 정보를 저장하는 제 3 단계(S30)와,
상기 후킹된 서블릿의 애플리케이션이 동작 중 상기 요청에 따라 필요시, 후킹된 데이터베이스 인터페이스를 통해 데이터베이스에게 작업을 요청하는 제 4 단계(S40)와,
상기 후킹된 데이터베이스 인터페이스에서 상기 스레드를 이용하여 저장된 상기 요청에 대한 정보와 상기 데이터베이스에 요청한 작업에 대한 정보를 함께 저장하는 제 5 단계(S50)를 포함하며,
상기 후킹된 서브릿의 클래스 로더를 통해 상기 와스를 실행하여 상기 와스의 기본 클래스 로더를 상기 후킹된 서브릿의 클래스 로더가 되도록 하고,
상기 와스에서 사용되는 커스텀 클래스 로더를 바이트 코드 패칭을 통해 후킹 클래스 로더로서 동작하도록 하는 로그 수집 방법.
As a log collection method that responds to requests from multiple users,
A first step (S10) of transmitting a request of a plurality of users to WAS (Web Application Server), respectively,
A second step (S20) of executing the hooked servlet corresponding to the request by creating a thread by the WASS;
A third step (S30) of storing information on the user's request in the thread by the hooked servlet,
A fourth step (S40) of requesting an operation from the database through the hooked database interface when the application of the hooked servlet is required according to the request during operation;
A fifth step (S50) of storing together information on the request stored using the thread in the hooked database interface and information on the operation requested in the database,
Execute the was through the class loader of the hooked servlet to make the base class loader of the was a class loader of the hooked servlet,
A log collection method in which the custom class loader used in WAS operates as a hooking class loader through byte code patching.
제 4 항에 있어서,
상기 스레드는 상기 사용자의 각각의 요청에 대해 각각의 TLS(Thread Local Storage)를 가지며,
상기 후킹된 서블릿은 상기 TLS에 상기 요청에 대한 정보를 저장하는 로그 수집 방법.
The method of claim 4,
The thread has a respective TLS (Thread Local Storage) for each request of the user,
The hooked servlet logs collection method for storing information on the request in the TLS.
제 5 항에 있어서,
상기 후킹된 데이터베이스 인터페이스는 해당하는 상기 스레드의 TLS에 접근하여 상기 요청에 대한 정보를 불러드려 상기 데이터베이스에 요청한 정보를 함께 저장하는 로그 수집 방법.
The method of claim 5,
The hooked database interface accesses the TLS of the corresponding thread, calls information on the request, and stores the requested information in the database together.
KR1020180152188A 2018-11-30 2018-11-30 System and method for collecting log KR102189125B1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
KR1020180152188A KR102189125B1 (en) 2018-11-30 2018-11-30 System and method for collecting log

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
KR1020180152188A KR102189125B1 (en) 2018-11-30 2018-11-30 System and method for collecting log

Publications (2)

Publication Number Publication Date
KR20200066427A KR20200066427A (en) 2020-06-10
KR102189125B1 true KR102189125B1 (en) 2020-12-10

Family

ID=71087086

Family Applications (1)

Application Number Title Priority Date Filing Date
KR1020180152188A KR102189125B1 (en) 2018-11-30 2018-11-30 System and method for collecting log

Country Status (1)

Country Link
KR (1) KR102189125B1 (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4356745B2 (en) 2004-03-18 2009-11-04 日本電気株式会社 Machine translation system, machine translation method and program
US20120035097A1 (en) 2009-04-28 2012-02-09 Targanta Therapeutics Corp. Methods of treating bacterial infections using oritavancin

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20050046373A (en) * 2003-11-14 2005-05-18 엘지엔시스(주) Method and system for managing log-file
KR101357135B1 (en) * 2012-06-14 2014-02-05 (주)아이비즈소프트웨어 Apparatus for Collecting Log Information

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4356745B2 (en) 2004-03-18 2009-11-04 日本電気株式会社 Machine translation system, machine translation method and program
US20120035097A1 (en) 2009-04-28 2012-02-09 Targanta Therapeutics Corp. Methods of treating bacterial infections using oritavancin

Also Published As

Publication number Publication date
KR20200066427A (en) 2020-06-10

Similar Documents

Publication Publication Date Title
US11921497B2 (en) Zero footprint robotic process automation system
US11243803B2 (en) Platform agnostic robotic process automation
US11954514B2 (en) Robotic process automation system with separate code loading
CN102375731B (en) Coding-free integrated application platform system
US9112777B1 (en) Tag-based resource configuration control
US9411616B2 (en) Classloader/instrumentation approach for invoking non-bound libraries
Dinh et al. Favocado: Fuzzing the Binding Code of JavaScript Engines Using Semantically Correct Test Cases.
US20200110695A1 (en) Dynamic integration of command line utilities
US11301224B1 (en) Robotic process automation system with a command action logic independent execution environment
Shahriar et al. Testing of memory leak in android applications
US20070276630A1 (en) Enabling high availability and load balancing for jmx mbeans
US11836072B2 (en) Risk-based root cause identification methods and related autobuild systems
WO2020223365A1 (en) Zero footprint robotic process automation system
Wang et al. Auxo: an architecture-centric framework supporting the online tuning of software adaptivity
Peck et al. Ghost: A uniform and general-purpose proxy implementation
US11288108B2 (en) Automatic out-of-bound access prevention in GPU kernels executed in a managed environment
KR102189125B1 (en) System and method for collecting log
US10977218B1 (en) Distributed application development
Kästner et al. Safety-critical software development in c++
US20220156363A1 (en) Multi -tenant actor systems with web assembly
Mosa et al. Towards a cloud native big data platform using micado
Minh Do et al. A divide & conquer approach to testing concurrent Java programs with JPF and Maude
Sandikkaya et al. Practical runtime security mechanisms for an aPaaS cloud
Schmitt et al. A Workflow Management System Guide
US11960861B1 (en) System and method for code development tools existing within code container

Legal Events

Date Code Title Description
E701 Decision to grant or registration of patent right
GRNT Written decision to grant