Method for dynamically outputting log file according to time

A technology for outputting logs and log files, applied in the field of dynamically outputting log files by time, can solve problems such as insufficiency, and achieve the effects of preventing output efficiency from becoming lower, locating paths quickly, and improving retrieval efficiency

Inactive Publication Date: 2010-02-10
CASCO SIGNAL
View PDF0 Cites 13 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

The rollback output log file is considered in terms of the size of each log file and the number of log files, which cannot meet the above requirements
In this case, in order to solve the above problems, a method of dynamically outputting log files according to time is proposed. After file retrieval, it is found that there is no such method at present

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • Method for dynamically outputting log file according to time
  • Method for dynamically outputting log file according to time
  • Method for dynamically outputting log file according to time

Examples

Experimental program
Comparison scheme
Effect test

Embodiment 1

[0054] (1) Define file naming rules. The log file name contains time information, and its format is YYYYMMDDHHMM. For example, the format of 1:1 on January 1, 2009 is 200901010101; the prefix and suffix strings in the file name are recorded as PRE and APP respectively; the sequence in the file name The number is denoted as SEQ. Let the file name format be PRE‖YYYYMMDDHHMMSS‖SEQ‖APP, where‖ is a traditional binary string connector;

[0055] (2) Define time granularity. It is assumed that a new log file is created every k minutes, where 01440, this method can be extended;

[0056] (3) Define the file size threshold. Let the log file size threshold be M, where M>0;

[0057] (4) Obtain the file name. First, calculate the time string in the file name based on the current time and the defined time granularity. The specific calculation method is as follows:

[0058] HH = HH C ...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to view more

PUM

No PUM Login to view more

Abstract

The invention relates to a method for dynamically outputting a log file according to time, comprising the following steps: file naming rules are defined, and time information is set in a file name; time granularity is defined, and the granularity of an output log file is defined according to the size and the output frequency of an output log; a size threshold M of the file is defined, and the sizeof each output log file can not be bigger than the threshold M; the file name and a file sequence number are obtained; and the log file is output, and the log is output into the log file. Compared with the prior art, the invention has the advantages that the method adopts a dynamic thought, provides the method for dynamically outputting the log file according to the time, describes each log filefrom the angle of the time, provides a new method for outputting the log file, is convenient to fast position the log according to the time, improves the log retrieval efficiency, and provides a faster positioning approach for event analysis in a software system running process.

Description

technical field [0001] The invention relates to a method for outputting log files, in particular to a method for dynamically outputting log files according to time. Background technique [0002] In a software system, a log function is needed to record events that occur during the running of the software system. Some current log modules include Log4cpp, Log4j, Log4cxx, etc. These modules provide a unified log input interface, and output logs to files, log servers, or databases through one or more log output managers. When outputting logs to files in these modules, only the function of rolling back the output log files is provided, that is, the maximum value M of the size of each log file and the maximum number C of log files that can be output are set, and the log files are output according to the following rules: [0003] (1) The size of each output log file does not exceed M; [0004] (2) The number of output log files is not greater than C; [0005] (3) Each output log ...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to view more

Application Information

Patent Timeline
no application Login to view more
IPC IPC(8): G06F11/34
Inventor 郝黎明
Owner CASCO SIGNAL
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Try Eureka
PatSnap group products