CN110389882B - Log recording method, system and related device for system event - Google Patents

Log recording method, system and related device for system event Download PDF

Info

Publication number
CN110389882B
CN110389882B CN201910563049.0A CN201910563049A CN110389882B CN 110389882 B CN110389882 B CN 110389882B CN 201910563049 A CN201910563049 A CN 201910563049A CN 110389882 B CN110389882 B CN 110389882B
Authority
CN
China
Prior art keywords
record
preset
fdr
system event
log
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
CN201910563049.0A
Other languages
Chinese (zh)
Other versions
CN110389882A (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.)
Suzhou Inspur Intelligent Technology Co Ltd
Original Assignee
Suzhou Inspur Intelligent 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 Suzhou Inspur Intelligent Technology Co Ltd filed Critical Suzhou Inspur Intelligent Technology Co Ltd
Priority to CN201910563049.0A priority Critical patent/CN110389882B/en
Publication of CN110389882A publication Critical patent/CN110389882A/en
Application granted granted Critical
Publication of CN110389882B publication Critical patent/CN110389882B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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/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

The application provides a log recording method of system events, which comprises the following steps: when a preset system event is detected, triggering an FDR record; acquiring the change process of the preset system event according to preset recording parameters, and writing the change process into the FDR record; and after the preset system event lasts for a preset time, stopping writing and storing the FDR record. The FDR records are used for recording the system events when the system events occur, the dynamic process of the system events can be recorded within the preset time, the real-time running process record of the system events is provided, and a user can conveniently master the running state of the server. The application also provides a system event logging system, a computer readable storage medium and a server, which have the beneficial effects.

Description

Log recording method, system and related device for system events
Technical Field
The present application relates to the field of servers, and in particular, to a method, a system, and a related device for logging system events.
Background
Currently, after an error occurs in a software system of a server, it is often necessary to continuously monitor a relevant state and record a log for a certain period of time. For the traditional log recording mode, the change situation of the state of a system in a period of time after the system has a problem cannot be reflected. And the state change situation is information that an engineer needs to know. The existing log records can only acquire the occurrence time of the system events, which is not beneficial for engineers to know the operation state of the server.
Disclosure of Invention
The application aims to provide a log recording method, a log recording system, a computer readable storage medium and a server for system events, and solves the problem that the existing log cannot record the content of the system events.
In order to solve the above technical problem, the present application provides a method for logging system events, which has the following specific technical scheme:
when a preset system event is detected, triggering an FDR record;
acquiring the change process of the preset system event according to preset recording parameters, and writing the change process into the FDR record;
and after the preset system event lasts for a preset time, stopping writing and storing the FDR record.
Wherein, still include:
configuring a trigger condition of the FDR record;
and setting the preset recording parameters and the preset time.
Wherein, when detecting that preset system event takes place, still include:
generating a log record; wherein the log record comprises a target object name and an occurrence time of the preset system event.
Wherein, after stopping writing and storing the FDR record, the method further comprises:
storing the FDR record in association with the log record.
The present application further provides a system for logging system events, comprising:
the record generation module is used for triggering FDR record when detecting that a preset system event occurs;
the record writing module is used for acquiring the change process of the preset system event according to preset record parameters and writing the change process into the FDR record;
and the record storage module is used for stopping writing and storing the FDR record after the preset system event lasts for the preset time.
Wherein, still include:
the first configuration module is used for configuring the trigger condition of the FDR record;
and the second configuration module is used for setting the preset recording parameters and the preset time.
Wherein, still include:
the second record generation module is used for generating log records; wherein the log record comprises a target object name and an occurrence time of the preset system event.
Wherein the record storage module is further configured to store the FDR record in association with the log record.
The present application also provides a computer readable storage medium having stored thereon a computer program which, when being executed by a processor, carries out the steps of the logging method as described above.
The present application further provides a server, including a memory and a processor, where the memory stores a computer program, and the processor implements the steps of the logging method when calling the computer program in the memory.
The application provides a log recording method of system events, which comprises the following steps: when a preset system event is detected, triggering an FDR record; acquiring the change process of the preset system event according to preset recording parameters, and writing the change process into the FDR record; and after the preset system event lasts for a preset time, stopping writing and storing the FDR record.
According to the method and the system, the FDR record is utilized to record the system event when the system event occurs, the dynamic process of the system event can be recorded within the preset time, the real-time running process record of the system event is provided, and a user can conveniently master the running state of the server. The application also provides a system event, a log recording system, a computer readable storage medium and a server, which have the above beneficial effects and are not described herein again.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments or the prior art will be briefly introduced below, it is obvious that the drawings in the following description are only embodiments of the present application, and for those skilled in the art, other drawings can be obtained according to the provided drawings without creative efforts.
FIG. 1 is a flowchart illustrating a method for logging system events according to an embodiment of the present application;
fig. 2 is a schematic structural diagram of a logging system for logging system events provided by the present application according to an embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are some embodiments of the present application, but not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
Referring to fig. 1, fig. 1 is a flowchart illustrating a method for logging system events according to an embodiment of the present application, where the method for logging system events includes:
s101: when a preset system event is detected, triggering an FDR record;
this step is intended to trigger FDR recording when a preset system event is detected. The preset system event is not specifically limited, and may be set according to the actual requirement of the server, and may be one event or a series of target events. When a series of target system events are set to be detected, the FDR record is triggered as long as any project target system event occurs.
The preset system event may include, but is not limited to, an operating state of a power supply (a real-time voltage value, a temperature of the power supply, etc.), a real-time temperature of each component in the server, an operating state of the motherboard, an operating state of the fan system (a fan speed, a real-time voltage stability, etc.), a communication state (for example, a communication feedback duration, a communication signal stability, etc.), and the like, and a specific preset system event may be set by a person skilled in the art accordingly, and is not limited specifically herein. It should be noted that typically, for each system event, a separate FDR record is assigned. If the same component or the same type of component is used, for example, it is detected that the power supply voltage is unstable and the power supply temperature is abnormal, one FDR record may be generated at this time, or two records may be selectively generated, that is, the generation number of the FDR records may be set by a person skilled in the art according to actual requirements.
It is easily understood that, generally, before performing step S101, it is also necessary to configure the trigger condition of the FDR recording, and to set the preset recording parameter and the preset time. It should be noted that different trigger conditions of different preset system events are different, and corresponding settings should be made according to specific event contents. For example, for a component of a power supply, if the predetermined system event is that the power supply temperature is too high, the triggering condition is that the temperature exceeds a certain threshold, the corresponding predetermined recording parameter corresponds to a temperature variation curve, and the predetermined time is set according to requirements. Similarly, for the power supply module, if the preset system event is that the power supply voltage is unstable, the trigger condition at this time is that the power supply voltage exceeds the preset fluctuation range, the corresponding preset recording parameter corresponds to a voltage variation curve, and the preset time is set as required.
In addition, the preset time can be determined by setting the detection frequency. It is easy to understand that no matter what kind of parameters are detected, the corresponding detection frequency is required, and the detection frequency of the preset system event is not limited herein, and may be detected once in 2s, or once in 0.5 s, and the like, and may be adjusted according to the corresponding preset system event. For example, for the power supply temperature, assuming that the power supply temperature needs to be detected every 5 seconds, the preset time is 100 seconds if 20 sets of temperature data are usually required. Of course, the preset time can be directly set by a person skilled in the art, and the corresponding preset time can be different for different preset system events.
It should be noted that there may be a plurality of preset system events, and each preset system event is performed independently, so that corresponding FDR records may be generated. One FDR record may correspond to a different pre-defined system event.
S102: acquiring the change process of the preset system event according to preset recording parameters, and writing the change process into the FDR record;
this step aims to obtain the change process of the preset system event. Different from the prior art that the log record only records the brief contents such as the occurrence time of the event, the step needs to record the change process of the preset system event, and the preset record parameters are different due to different preset system events, which is not limited herein.
For example, if the preset system event is a power temperature, the corresponding preset system event is that the power temperature exceeds 60 degrees celsius, once the power temperature exceeds 60 degrees celsius, the FDR record is started when the power temperature is detected to be excessive in S101, and at this time, the preset recording parameter is the power temperature, and the power temperature is detected and written into the FDR record within a period of time after the FDR record is started.
It can be seen that this step implements process logging for system events, whereas existing log files only perform point-in-time logging for system events.
S103: and after the preset system event lasts for a preset time, stopping writing and storing the FDR record.
This step is intended to illustrate that FDR recording requires recording a preset time. It can be understood that the system events are divided into normal events and unexpected events, the normal events refer to normal operating states of the server during operation, and normal state fluctuations may exist in each component, for example, after the server is started, the temperature of the CPU may change continuously due to different utilization degrees, but once a certain threshold value is exceeded or a high temperature is continuously maintained, the normal events belong to unexpected events, that is, damage or other adverse effects are caused to the server. However, the FDR record cannot continuously record the event, on one hand, a large storage space is occupied, and on the other hand, certain system resources are consumed when the FDR record is written, so that the FDR record only needs to be continued for a preset time.
The storage mode and storage location of the FDR record are not limited herein, and the FDR record can be stored in the same location as the conventional system log, so that the FDR record can be conveniently searched by a user.
According to the method and the system, the FDR record is utilized to record the system event when the system event occurs, the dynamic process of the system event can be recorded within the preset time, the process record aiming at the preset system event is realized, the existing log file only carries out time point record aiming at the system event, and the working state of a user for controlling the server is not facilitated. In contrast, the embodiment of the application provides real-time running process records of system events, so that a user can conveniently master the running state of the server.
Based on the foregoing embodiment, as a preferred embodiment, when the step S101 detects that the preset system event occurs, the method may further include:
and generating a log record, wherein the log record comprises the name and the occurrence time of the target object of the preset system event.
The log record refers to a common system log, and when a preset system event occurs, the common system log usually only records the event occurrence and the event occurrence position for a user to view.
While the ordinary system log and FDR record can be generated simultaneously, the former records the time point for the preset system event, and the latter records the process of the system event.
Based on the foregoing embodiment, as a preferred embodiment, after stopping writing and storing the FDR record, the method further includes:
storing the FDR record in association with the log record.
The FDR record can be stored in association with the log record for easy viewing by a user. For example, the log record may record the time of occurrence of the high temperature of the power supply, while the FDR record records the real-time temperature of the power supply for a period of time after the time of occurrence. When the log record and the FDR record are stored, the FDR record is stored after the log record or in parallel. Because an FDR record is typically data after the time point at which the corresponding log record was recorded, the FDR record can be stored in association with the log record, which also facilitates storing, recording, and traversing the FDR record.
In the following, a logging system of system events provided by the embodiments of the present application is introduced, and the logging system described below and the logging method of system events described above may be referred to correspondingly.
Referring to fig. 2, fig. 2 is a schematic structural diagram of a logging system for system events provided in the present application according to an embodiment of the present application, and the present application further provides a logging system for system events, including:
the record generating module 100 is configured to trigger an FDR record when detecting that a preset system event occurs;
a record writing module 200, configured to obtain a change process of the preset system event according to a preset record parameter, and write the change process into the FDR record;
and a record storage module 300, configured to stop writing and store the FDR record after the preset system event lasts for a preset time.
Based on the foregoing embodiment, as a preferred embodiment, the logging system may further include:
the first configuration module is used for configuring the trigger condition of the FDR record;
and the second configuration module is used for setting the preset recording parameters and the preset time.
Based on the above embodiment, as a preferred embodiment, the logging system may further include:
and the second record generation module is used for generating a log record, wherein the log record comprises the name and the occurrence time of the target object of the preset system event.
Based on the foregoing embodiment, as a preferred embodiment, the record storage module 300 is further configured to store the FDR record in association with the log record.
The present application also provides a computer readable storage medium, on which a computer program is stored, which when executed can implement the steps of a method for logging system events provided by the above embodiments. The storage medium may include: various media capable of storing program codes, such as a usb disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.
The present application further provides a terminal, which may include a memory and a processor, where the memory stores a computer program, and when the processor calls the computer program in the memory, the steps of the method for logging a system event provided in the foregoing embodiment may be implemented. Of course, the terminal may also include various network interfaces, power supplies, and the like.
The embodiments are described in a progressive manner in the specification, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other. For the system provided by the embodiment, the description is relatively simple because the system corresponds to the method provided by the embodiment, and the relevant points can be referred to the method part for description.
The principles and embodiments of the present application are explained herein using specific examples, which are provided only to help understand the method and the core idea of the present application. It should be noted that, for those skilled in the art, it is possible to make several improvements and modifications to the present application without departing from the principle of the present application, and such improvements and modifications also fall within the scope of the claims of the present application.
It is further noted that, in the present specification, relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.

Claims (6)

1. A method for logging system events, comprising:
when a preset system event is detected, triggering an FDR record;
acquiring the change process of the preset system event according to preset recording parameters, and writing the change process into the FDR record;
after the preset system event lasts for a preset time, stopping writing and storing the FDR record, and storing the FDR record and the log record in a correlation manner;
wherein, when detecting that preset system event takes place, still include:
generating a log record; and the log record comprises the name and the occurrence time of the target object of the preset system event.
2. The logging method of claim 1, further comprising:
configuring a trigger condition of the FDR record;
and setting the preset recording parameters and the preset time.
3. A system for logging system events, comprising:
the record generation module is used for triggering FDR record when detecting that a preset system event occurs;
the record writing module is used for acquiring the change process of the preset system event according to preset record parameters and writing the change process into the FDR record;
the record storage module is used for stopping writing and storing the FDR record after the preset system event lasts for a preset time, and storing the FDR record and the log record in a correlation manner;
the second record generation module is used for generating log records; wherein the log record comprises a target object name and an occurrence time of the preset system event.
4. The logging system of claim 3, further comprising:
the first configuration module is used for configuring the trigger condition of the FDR record;
and the second configuration module is used for setting the preset recording parameters and the preset time.
5. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the logging method as claimed in any one of the claims 1-2.
6. A server, characterized by comprising a memory in which a computer program is stored and a processor which, when calling the computer program in the memory, implements the steps of the logging method according to any of claims 1-2.
CN201910563049.0A 2019-06-26 2019-06-26 Log recording method, system and related device for system event Active CN110389882B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910563049.0A CN110389882B (en) 2019-06-26 2019-06-26 Log recording method, system and related device for system event

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910563049.0A CN110389882B (en) 2019-06-26 2019-06-26 Log recording method, system and related device for system event

Publications (2)

Publication Number Publication Date
CN110389882A CN110389882A (en) 2019-10-29
CN110389882B true CN110389882B (en) 2022-07-08

Family

ID=68285749

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910563049.0A Active CN110389882B (en) 2019-06-26 2019-06-26 Log recording method, system and related device for system event

Country Status (1)

Country Link
CN (1) CN110389882B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113992503B (en) * 2021-11-02 2024-03-19 迈普通信技术股份有限公司 System event review method, network management system, network management equipment and storage medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108897666A (en) * 2018-06-29 2018-11-27 郑州云海信息技术有限公司 Server failure log generation method and relevant device
CN109542844A (en) * 2018-12-03 2019-03-29 郑州云海信息技术有限公司 A kind of event log collection method, system and electronic equipment and storage medium
CN109726130A (en) * 2019-01-02 2019-05-07 浪潮商用机器有限公司 Test macro, method, equipment and the storage medium of BMC event log strategy

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108897666A (en) * 2018-06-29 2018-11-27 郑州云海信息技术有限公司 Server failure log generation method and relevant device
CN109542844A (en) * 2018-12-03 2019-03-29 郑州云海信息技术有限公司 A kind of event log collection method, system and electronic equipment and storage medium
CN109726130A (en) * 2019-01-02 2019-05-07 浪潮商用机器有限公司 Test macro, method, equipment and the storage medium of BMC event log strategy

Also Published As

Publication number Publication date
CN110389882A (en) 2019-10-29

Similar Documents

Publication Publication Date Title
CN110888889B (en) Data information updating method, device and equipment
CN112346829B (en) Method and equipment for task scheduling
CN106469087B (en) Metadata output method, client and metadata server
CN111143104A (en) Memory exception processing method and system, electronic device and storage medium
CN107168775B (en) Method and device for automatically processing suspension affairs
CN108983922A (en) Working frequency adjusting method, device and server
US8538925B2 (en) System and method for backing up test data
US8234526B2 (en) Computer system and monitoring device
CN110389882B (en) Log recording method, system and related device for system event
CN108763046B (en) Thread running monitoring method, device, computer equipment and storage medium
CN111381964A (en) Dynamic adjustment system, method and storage medium for memory execution speed
CN113239012B (en) Database migration method and device, electronic equipment and storage medium
CN106326060A (en) Baseplate management control system and method for same
US20160216925A1 (en) Information mediation system, information mediation method, information accumulating system, and information processing method
CN107491455B (en) Reading method and device in distributed system
US11930292B2 (en) Device state monitoring method and apparatus
CN110928885B (en) Method and device for updating data of Mysql database to Es database
CN109102839B (en) Bad block marking method, device, equipment and readable storage medium
CN110928945B (en) Data processing method and device for database and data processing system
CN114327259B (en) Flash memory channel controller operation method, device, equipment and storage medium
CN115080132A (en) Information processing method, information processing apparatus, server, and storage medium
CN110442467B (en) Data sharing method, terminal and computer readable storage medium
US20130227226A1 (en) Electronic device and method for data backup
CN109241011B (en) Virtual machine file processing method and device
CN110597828A (en) Database changing method, device, equipment and storage 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