Method for recording logs with file by flexibly planning catalog

A file recording and logging technology, applied in special data processing applications, instruments, electrical digital data processing, etc., can solve problems such as difficulty in recording logs and slow recording speed

Inactive Publication Date: 2009-10-21
北京闻言科技有限公司
View PDF0 Cites 9 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0002] Using files to record logs is a general method of recording logs, but with the large increase of logs, the log files will become larger and larger, and the speed of recording logs will become slower and slower. It is difficult to achieve the purpose of recording a large number of logs by using a single file;

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 recording logs with file by flexibly planning catalog

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0016] see figure 1 , the main steps of the present invention are as follows:

[0017] Step 1: The application configures the directory where the logs are stored through the configuration file.

[0018] Step 2: The log manager reads the log directory configured in the application configuration file. If there is no such directory, it will be established.

[0019] Step 3: The application initiates a log recording request to the log manager.

[0020] Step 4: The application program generates a subdirectory in the format of "year-month-day" according to the current time, and establishes the subdirectory.

[0021] Step 5: Create a log file with a serial number starting from 1 as the file name and "txt" as the extension.

[0022] Step 6: The log manager writes the file to the log.

[0023] Step 7: When recording again, the log manager will check whether the log file has reached the configured length. If it has reached the configured length, a second file will be created, with 2,...

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 discloses a method for recording logs with a file by flexibly planning a catalog. The method comprises the following steps: an application configures the catalog in which the logs are to be recorded by a configuration file; a log manager reads the log catalog configured in the configuration file of the application program; the application program initiates a request for recording the logs to the log manager, generates a subcatalog in format of 'year-month-date' according to current time and establishes the subcatalog; the log manager establishes the log file by taking a serial number from 1 as a file name and 'txt' as an extension name; the log manager writes the file into the log; the log manager detects whether the log file reaches configured length while recording again, and if yes, the log manager establishes a second file by sequentially taking 2, 3, 4 and the like as the file names and 'txt' as the extension name; and finally, the log manager clears the logs periodically. The method helps plan the catalog for the log files automatically during management of recording logs with files.

Description

technical field [0001] The invention relates to a method for flexibly planning directories to use file recording logs, in particular to a method for automatically planning directories for log files in file recording log management. Background technique [0002] Using files to record logs is a general method of recording logs, but with the large increase of logs, the log files will become larger and larger, and the speed of recording logs will become slower and slower. It is difficult to achieve the purpose of recording a large number of logs by using a single file; [0003] The present invention will use the current time to plan the log storage directory, and decide whether to enable another log file according to the size of the log file; Contents of the invention [0004] The technical problem to be solved by the present invention is to provide a method for automatically planning directories for log files in log management using file records. [0005] A method for flexib...

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
Patent Type & Authority Applications(China)
IPC IPC(8): G06F17/30
Inventor 汤海京徐友春朱红军孙涛赵峰刘莹
Owner 北京闻言科技有限公司
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