CN111966643B - System and method for dynamically adjusting log grade according to log resource - Google Patents

System and method for dynamically adjusting log grade according to log resource Download PDF

Info

Publication number
CN111966643B
CN111966643B CN202010986304.5A CN202010986304A CN111966643B CN 111966643 B CN111966643 B CN 111966643B CN 202010986304 A CN202010986304 A CN 202010986304A CN 111966643 B CN111966643 B CN 111966643B
Authority
CN
China
Prior art keywords
log
grade
application programs
module
role
Prior art date
Legal status (The legal status 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 status listed.)
Active
Application number
CN202010986304.5A
Other languages
Chinese (zh)
Other versions
CN111966643A (en
Inventor
晏东
吴晓勇
沈芫玉
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Chengdu Ghostcloud Technology Co ltd
Original Assignee
Chengdu Ghostcloud Technology Co ltd
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 Chengdu Ghostcloud Technology Co ltd filed Critical Chengdu Ghostcloud Technology Co ltd
Priority to CN202010986304.5A priority Critical patent/CN111966643B/en
Publication of CN111966643A publication Critical patent/CN111966643A/en
Application granted granted Critical
Publication of CN111966643B publication Critical patent/CN111966643B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/17Details of further file system functions
    • G06F16/1734Details of monitoring file system events, e.g. by the use of hooks, filter drivers, logs
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/18File system types
    • G06F16/1805Append-only file systems, e.g. using logs or journals to store data
    • G06F16/1815Journaling file systems
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The invention relates to the field of log level dynamic configuration, in particular to a system for dynamically adjusting log levels according to log resources, which comprises a role configuration module, a storage module, a log level configuration module and a log resource monitoring module, wherein the method for dynamically adjusting the log levels comprises the following steps: s1, marking each application program needing to dynamically adjust log level through a role configuration module by a user, and allowing the same application program to use the same mark; s2, a user sets the log grade of one of the application programs through a storage module, and the storage module sends a modification notification to a log resource monitoring module; s3, the log resource monitoring module judges whether other application programs with the same marks as the application programs in the step S2 exist or not through the log level configuration module, if not, the process is finished, if not, the log levels of the other application programs with the same marks are set, and the problem that the log levels of a plurality of independent application programs cannot be modified in batches is solved.

Description

System and method for dynamically adjusting log grade according to log resource
Technical Field
The invention relates to the field of log level dynamic configuration, in particular to a system and a method for dynamically adjusting log levels according to log resources.
Background
In the present era, thanks to the rapid development of container technologies (such as dockers) and container orchestration engines (such as kubernetes), more and more programs begin to adopt architecture designs conforming to cloud primordia, so that developed applications can be conveniently and conveniently containerized, and can be conveniently clouded, and enjoy various advantages such as agile application program creation and deployment, environment consistency across development, testing and production, loose coupling, distributed, elastic, free micro-services, resource isolation, resource utilization and the like provided by various container orchestration engines. Therefore, the application of micro-service architecture is also becoming more popular.
However, the micro service architecture also brings a lot of problems, namely, dynamic adjustment of the log level is one point, and since the whole system is divided into a plurality of independent application programs, if the log level of a certain part of programs is to be adjusted, each program can be adjusted in turn.
Disclosure of Invention
Based on the problems, the invention provides a system and a method for dynamically adjusting log levels according to log resources, which solve the problem that log levels of a plurality of independent application programs cannot be modified in batches.
In order to solve the technical problems, the invention adopts the following technical scheme:
a system for dynamically adjusting log levels based on log resources includes
The role configuration module is used for pre-configuring a log role when each program requiring dynamic adjustment of log level is started;
the storage module is used for modifying log grades of log roles of the external program and the user;
the log grade configuration module is used for checking and modifying the log grade of the log role by the internal program;
the log resource monitoring module is respectively connected with the storage module and the log grade configuration module and is used for monitoring the change condition of the log grade in the storage module and checking and modifying the log grade of the log role by calling the log grade configuration module.
Further, the storage module includes a log level modification external interface, and the log configuration module includes a log level view internal interface and a log level modification internal interface.
The method for dynamically adjusting the log grade adopts a system for dynamically adjusting the log grade according to log resources, and comprises the following steps:
s1, marking each application program needing to dynamically adjust log level through a role configuration module by a user, and allowing the same application program to use the same mark;
s2, a user sets the log grade of one of the application programs through a storage module, and the storage module sends a modification notification to a log resource monitoring module;
and S3, the log resource monitoring module judges whether other application programs with the same marks as the application programs in the step S2 exist or not through the log grade configuration module, if not, the processing is ended, the next event triggering is waited, and if so, the log resource monitoring module calls the log grade configuration module to set the log grade of the other application programs with the same marks.
Further, in the step S1, the user configures a log role for each application program requiring dynamic adjustment of log level through the role configuration module, and allows the same application program to use a log role.
Further, in step S2, the user modifies the log level of one of the application programs by calling the log level modification external interface, and the storage module sends a modification notification to the log resource monitoring module.
Further, in the step S3, the method further includes the following steps:
s31, the log resource monitoring module calls a log grade to check whether other application programs with the same mark as the application program in the step S2 exist in the internal interface, if not, the processing is finished, the next event triggering is waited, and if so, the step S32 is executed;
s32, the log resource monitoring module acquires log levels of other application programs with the same mark, if the log levels of the other application programs are the same as the log levels of the application programs in the step S2, the processing is ended, the next event triggering is waited, if the log levels of the other application programs are different from the log levels of the application programs in the step S2, the step S33 is executed;
s33, the log resource monitoring module calls a log level modification internal interface to modify the log levels of other application programs.
Compared with the prior art, the invention has the beneficial effects that: the log resource monitoring module can query other application programs with the same log roles through the log level configuration module after the log level of a certain application program is modified by the role configuration module, so as to modify the log level of the certain application program, complete the log level modification of all the application programs with the same log roles, and solve the problem that the log levels of a plurality of independent application programs cannot be modified in batches after the application programs are restarted.
Drawings
FIG. 1 is a flow chart of the present invention.
Detailed Description
The invention is further described below with reference to the accompanying drawings. Embodiments of the present invention include, but are not limited to, the following examples.
In this embodiment, a system for implementing application migration based on a sentinel mode includes
The role configuration module is used for pre-configuring a log role when each program requiring dynamic adjustment of log level is started;
the storage module comprises a log grade modification external interface which is used for modifying the log grade of the log roles of the external program and the user, and simultaneously, the storage module sends the log grade change condition of the application program to the listener to play a role of an interaction center.
The log level configuration module is used for checking and modifying the log level of the log role by the internal program, and concretely comprises a log level checking internal interface and a log level modifying internal interface.
The log resource monitoring module is respectively connected with the storage module and the log grade configuration module, monitors the change condition of the log grade in the storage module, checks the log grade of the application program by calling the log grade to check the internal interface when the log grade needs to be adjusted, and modifies the log grade of the application program by calling the log grade to modify the internal interface.
As shown in fig. 1, the method for dynamically adjusting log level adopts a system for dynamically adjusting log level according to log resources, and comprises the following steps:
s1, a user configures a log role for each application program needing to dynamically adjust log level through a role configuration module, and the same application program is allowed to use the same log role;
s2, a user modifies the log grade of one of the application programs by calling a log grade modification external interface, and the storage module sends a modification notification to the log resource monitoring module;
s3, the log resource monitoring module calls the log grade to check whether other application programs with the same marks as the application program in the step S2 exist in the internal interface, if not, the processing is ended, the next event triggering is waited, if found, the log resource monitoring module obtains the log grade of the other application programs with the same marks, if the log grade of the other application programs is the same as the log grade of the application program in the step S2, the processing is ended, the processing is waited for the next event triggering, if the log grade of the other application programs is different from the log grade of the application program in the step S2, and the log resource monitoring module calls the log grade modification internal interface to modify the log grade of the other application programs.
For example, in this case, there are a total of 5 independent applications, namely, application 1, application 2, application 3, application 4, and application 5, and in this case, application 1, application 3, and application 5 are the same independent applications, and in this case, application 1, application 3, and application 5 may be configured with a same log role a through the role configuration module, and application 2 may be configured with a log role B through the role configuration module, and application 4 may be configured with a log role C through the role configuration module.
The user modifies the log grade of the application program 1 by calling the log grade modification external interface, the storage module sends a modification notice to the log resource monitoring module, the log resource monitoring module calls the log grade to check whether other application programs with the log role A are available for the internal interface to check, and at the moment, the application program 3 and the application program 5 can be checked to have the same log role A, so that the log resource monitoring module obtains the log grade of the application program 3 and the log grade of the application program 5, if the log grade of the application program 3 and the log grade of the application program 5 are the same as the log grade of the application program 1, the processing is finished, the next event triggering is waited, and if the log grade of the application program 3 and the log grade of the application program 5 are different from the log grade of the application program 1, the log resource monitoring module calls the log grade modification internal interface to modify the log grade of the application program 3 and the log grade of the application program 5, and the problem that the log grade cannot be modified in batches when the whole system is divided into a plurality of independent application programs is solved.
If the user modifies the log grade of the application program 2 by calling the log grade modification external interface, the storage module sends a modification notification to the log resource monitoring module, and the log resource monitoring module calls the log grade to check whether other application programs with the log role B are available for the application program 2 or not through the internal interface, and at the moment, other application programs without the log role B can be checked, so that the processing is finished and the next event triggering is waited.
The above is an embodiment of the present invention. The above embodiments and specific parameters in the embodiments are only for clearly describing the inventive verification process of the inventor, and are not intended to limit the scope of the invention, which is defined by the claims, and all equivalent structural changes made by applying the descriptions and the drawings of the invention are included in the scope of the invention.

Claims (5)

1. The method for dynamically adjusting the log grade according to the log resource is characterized by comprising the following steps of:
a system for dynamically adjusting log levels based on log resources includes
The role configuration module is used for pre-configuring a log role when each program requiring dynamic adjustment of log level is started;
the storage module is used for modifying log grades of log roles of the external program and the user;
the log grade configuration module is used for checking and modifying the log grade of the log role by the internal program;
the log resource monitoring module is respectively connected with the storage module and the log grade configuration module and is used for monitoring the change condition of the log grade in the storage module, and checking and modifying the log grade of the log role by calling the log grade configuration module;
when the log resource dynamic adjustment log grade system is adopted for adjustment, the method comprises the following steps:
s1, marking each application program needing to dynamically adjust log level through a role configuration module by a user, and allowing the same application program to use the same mark;
s2, a user sets the log grade of one of the application programs through a storage module, and the storage module sends a modification notification to a log resource monitoring module;
and S3, the log resource monitoring module judges whether other application programs with the same marks as the application programs in the step S2 exist or not through the log grade configuration module, if not, the processing is ended, the next event triggering is waited, and if so, the log resource monitoring module calls the log grade configuration module to set the log grade of the other application programs with the same marks.
2. The method for dynamically adjusting log levels based on log resources according to claim 1, wherein: the storage module comprises a log level modification external interface, and the log configuration module comprises a log level viewing internal interface and a log level modification internal interface.
3. The method for dynamically adjusting log levels based on log resources according to claim 1, wherein: in step S1, a user configures a log role for each application program requiring dynamic adjustment of log level through a role configuration module, and allows the same application program to use a log role.
4. The method for dynamically adjusting log levels based on log resources according to claim 1, wherein: in step S2, the user modifies the log level of one of the application programs by calling the log level modification external interface, and the storage module sends a modification notification to the log resource monitoring module.
5. The method for dynamically adjusting log levels based on log resources according to claim 1, wherein: in the step S3, the method further includes the following steps:
s31, the log resource monitoring module calls a log grade to check whether other application programs with the same mark as the application program in the step S2 exist in the internal interface, if not, the processing is finished, the next event triggering is waited, and if so, the step S32 is executed;
s32, the log resource monitoring module acquires log levels of other application programs with the same mark, if the log levels of the other application programs are the same as the log levels of the application programs in the step S2, the processing is ended, the next event triggering is waited, if the log levels of the other application programs are different from the log levels of the application programs in the step S2, the step S33 is executed;
s33, the log resource monitoring module calls a log level modification internal interface to modify the log levels of other application programs.
CN202010986304.5A 2020-09-18 2020-09-18 System and method for dynamically adjusting log grade according to log resource Active CN111966643B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010986304.5A CN111966643B (en) 2020-09-18 2020-09-18 System and method for dynamically adjusting log grade according to log resource

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010986304.5A CN111966643B (en) 2020-09-18 2020-09-18 System and method for dynamically adjusting log grade according to log resource

Publications (2)

Publication Number Publication Date
CN111966643A CN111966643A (en) 2020-11-20
CN111966643B true CN111966643B (en) 2023-05-05

Family

ID=73386976

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010986304.5A Active CN111966643B (en) 2020-09-18 2020-09-18 System and method for dynamically adjusting log grade according to log resource

Country Status (1)

Country Link
CN (1) CN111966643B (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2004152024A (en) * 2002-10-30 2004-05-27 Fujitsu Fip Corp Log management method and computer program using the method
CN107947954A (en) * 2016-10-12 2018-04-20 腾讯科技(深圳)有限公司 Dynamic adjustment journal stage other system, method and server
CN108897663A (en) * 2018-06-19 2018-11-27 新华三技术有限公司 log output control method and device
CN110058935A (en) * 2019-04-26 2019-07-26 广州华多网络科技有限公司 Log rank method of adjustment, apparatus and system, readable storage medium storing program for executing
CN111488230A (en) * 2019-01-29 2020-08-04 北京京东尚科信息技术有限公司 Method and device for modifying log output level, electronic equipment and storage medium

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9607065B2 (en) * 2013-04-26 2017-03-28 Netapp, Inc. Hierarchical coherency log for managing a distributed data storage system

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2004152024A (en) * 2002-10-30 2004-05-27 Fujitsu Fip Corp Log management method and computer program using the method
CN107947954A (en) * 2016-10-12 2018-04-20 腾讯科技(深圳)有限公司 Dynamic adjustment journal stage other system, method and server
CN108897663A (en) * 2018-06-19 2018-11-27 新华三技术有限公司 log output control method and device
CN111488230A (en) * 2019-01-29 2020-08-04 北京京东尚科信息技术有限公司 Method and device for modifying log output level, electronic equipment and storage medium
CN110058935A (en) * 2019-04-26 2019-07-26 广州华多网络科技有限公司 Log rank method of adjustment, apparatus and system, readable storage medium storing program for executing

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
汤网祥 ; 王金华 ; 赫凌俊 ; 李敏敬 ; .大规模软件系统日志汇集服务平台设计与实现.计算机应用与软件.2018,(第11期),179-184. *
胡聪 ; 张靖 ; 郭洋 ; .基于大数据日志管理系统的研究与实现.中国新通信.2017,(第09期),109-110. *

Also Published As

Publication number Publication date
CN111966643A (en) 2020-11-20

Similar Documents

Publication Publication Date Title
US20240064058A1 (en) Implementation of compliance settings by a mobile device for compliance with a configuration scenario
WO2016184175A1 (en) Database processing method and apparatus
EP3958126A1 (en) Micro-service component-based database system and related method
CN104717236A (en) Equipment performance test method and device
CN109656688B (en) Method, system and server for realizing distributed business rules
CN103678354A (en) Local relation type database node scheduling method and device based on cloud computing platform
CN110062022B (en) Method for updating API of server-side gray deployment application system
US20070150815A1 (en) Program execution service windows
CN108255708B (en) Method, device, storage medium and equipment for accessing production file in test environment
CN110535928B (en) Event pushing method for JAVA intelligent contract of block chain
WO2016169166A1 (en) Virtual machine scheduling method and device
US11868317B2 (en) Systems and methods for attachable-and-detachable database sessions
CN106406933B (en) One-key automatic deployment method for Tomcat cluster
CN104063303B (en) A method of obtaining and discharge root authority
CN111966643B (en) System and method for dynamically adjusting log grade according to log resource
CN110704210A (en) Script task calling method, system, medium and device
CN107015803A (en) Button monitor method and system based on Linux inner core
CN112698930B (en) Method, device, equipment and medium for obtaining server identification
CN112231106B (en) Access data processing method and device of Redis cluster
CN111158872B (en) Method and device for submitting and guarding spark task
WO2021169287A1 (en) Master-slave architecture configuration method, appartus and device, and computer-readable storage medium
US7962799B2 (en) System and method for synchronizing test runs on separate systems
US20130132456A1 (en) Decoupling cluster data from cloud depolyment
CN104506651B (en) A kind of virtual application service management and system
CN113190607B (en) HTTP request-based database load balancing method, device and medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
PE01 Entry into force of the registration of the contract for pledge of patent right
PE01 Entry into force of the registration of the contract for pledge of patent right

Denomination of invention: A system and method for dynamically adjusting log levels based on log resources

Effective date of registration: 20230719

Granted publication date: 20230505

Pledgee: Bank of Chengdu science and technology branch of Limited by Share Ltd.

Pledgor: CHENGDU GHOSTCLOUD TECHNOLOGY CO.,LTD.

Registration number: Y2023980049104