CN101561807A - Method for recording logs with file by flexibly planning catalog - Google Patents

Method for recording logs with file by flexibly planning catalog Download PDF

Info

Publication number
CN101561807A
CN101561807A CNA2008101043649A CN200810104364A CN101561807A CN 101561807 A CN101561807 A CN 101561807A CN A2008101043649 A CNA2008101043649 A CN A2008101043649A CN 200810104364 A CN200810104364 A CN 200810104364A CN 101561807 A CN101561807 A CN 101561807A
Authority
CN
China
Prior art keywords
log
file
log manager
catalog
logs
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.)
Pending
Application number
CNA2008101043649A
Other languages
Chinese (zh)
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.)
Beijing Wenyan Technology Co Ltd
Original Assignee
Beijing Wenyan 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 Beijing Wenyan Technology Co Ltd filed Critical Beijing Wenyan Technology Co Ltd
Priority to CNA2008101043649A priority Critical patent/CN101561807A/en
Publication of CN101561807A publication Critical patent/CN101561807A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Debugging And Monitoring (AREA)

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

A kind of flexible Catalogue Of Programme uses the method for file logging daily record
Technical field
The present invention relates to the method that a kind of flexible Catalogue Of Programme uses the file logging daily record, in particularly a kind of employing file logging log management, is the method for journal file Catalogue Of Programme automatically.
Background technology
Using the file logging daily record is the conventional method of log, but along with the rolling up of daily record, will make journal file increasing, and the speed of log can be more and more slower, uses single file to be difficult to reach the purpose of a large amount of daily records of record;
The present invention will use the current time to plan the daily record storing directory, and determine whether enabling another journal file according to the size of journal file;
Summary of the invention
Technical matters to be solved by this invention provides in a kind of employing file logging log management, is the method for journal file Catalogue Of Programme automatically.
A kind of flexible Catalogue Of Programme of the present invention uses the method for file logging daily record, and this method comprises following step at least:
Step 1: the catalogue that application program comes configuration log to deposit by configuration file.
Step 2: the Log Directory that log manager reads in the application profiles to be disposed, if this catalogue not will be set up this catalogue.
Step 3: application program is initiated the request of log to log manager.
Step 4: application program with the form generation sub-directory of " year-moon-Ri ", and is set up this sub-directory according to the current time.
Step 5: with since 1 sequence number as filename, be that extension name is set up journal file with " txt ".
Step 6: log manager writes daily record with this document.
Step 7: when writing down once more, log manager will check whether this journal file arrives the length that is disposed, if reach, then set up second file, successively with 2,3,4... is as filename, with " txt " as extension name.
Step 8: log manager periodic cleaning daily record.
A kind of flexible Catalogue Of Programme that the present invention relates to uses the method for file logging daily record, makes in using the file logging log management, and be the journal file Catalogue Of Programme automatically.
Description of drawings
Fig. 1 is a process flow diagram of the present invention.
Embodiment
Referring to Fig. 1, key step of the present invention is as follows:
Step 1: the catalogue that application program comes configuration log to deposit by configuration file.
Step 2: the Log Directory that log manager reads in the application profiles to be disposed, if this catalogue not will be set up this catalogue.
Step 3: application program is initiated the request of log to log manager.
Step 4: application program with the form generation sub-directory of " year-moon-Ri ", and is set up this sub-directory according to the current time.
Step 5: with since 1 sequence number as filename, be that extension name is set up journal file with " txt ".
Step 6: log manager writes daily record with this document.
Step 7: when writing down once more, log manager will check whether this journal file arrives the length that is disposed, if reach, then set up second file, successively with 2,3,4... is as filename, with " txt " as extension name.
Step 8: log manager periodic cleaning daily record.
In using the file logging log management, be the journal file Catalogue Of Programme automatically when above-mentioned technical scheme is implemented.
It should be noted last that above embodiment is only in order to explanation and unrestricted technical scheme described in the invention; Therefore, although this instructions has been described in detail the present invention with reference to the above embodiments,, those of ordinary skill in the art should be appreciated that still and can make amendment or replacement to the present invention with being equal to; And all do not break away from the technical scheme and the improvement thereof of the spirit and scope of the present invention, and it all should be encompassed in the middle of the claim scope of the present invention.

Claims (1)

1, a kind of flexible Catalogue Of Programme uses the method for file logging daily record, it is characterized in that: this method comprises following step at least:
Step 1: the catalogue that application program comes configuration log to deposit by configuration file.
Step 2: the Log Directory that log manager reads in the application profiles to be disposed, if this catalogue not will be set up this catalogue.
Step 3: application program is initiated the request of log to log manager.
Step 4: application program with the form generation sub-directory of " year-moon-Ri ", and is set up this sub-directory according to the current time.
Step 5: with since 1 sequence number as filename, be that extension name is set up journal file with " txt ".
Step 6: log manager writes daily record with this document.
Step 7: when writing down once more, log manager will check whether this journal file arrives the length that is disposed, if reach, then set up second file, successively with 2,3,4... is as filename, with " txt " as extension name.
Step 8: log manager periodic cleaning daily record.
CNA2008101043649A 2008-04-18 2008-04-18 Method for recording logs with file by flexibly planning catalog Pending CN101561807A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CNA2008101043649A CN101561807A (en) 2008-04-18 2008-04-18 Method for recording logs with file by flexibly planning catalog

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CNA2008101043649A CN101561807A (en) 2008-04-18 2008-04-18 Method for recording logs with file by flexibly planning catalog

Publications (1)

Publication Number Publication Date
CN101561807A true CN101561807A (en) 2009-10-21

Family

ID=41220614

Family Applications (1)

Application Number Title Priority Date Filing Date
CNA2008101043649A Pending CN101561807A (en) 2008-04-18 2008-04-18 Method for recording logs with file by flexibly planning catalog

Country Status (1)

Country Link
CN (1) CN101561807A (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102054036A (en) * 2010-12-29 2011-05-11 北京新媒传信科技有限公司 File synchronizing method and device
CN103309792A (en) * 2012-03-12 2013-09-18 联想(北京)有限公司 Method and system for controlling log information
CN104714878A (en) * 2013-12-11 2015-06-17 阿里巴巴集团控股有限公司 Method and device for collecting log data
CN105279239A (en) * 2015-09-28 2016-01-27 浪潮(北京)电子信息产业有限公司 Metadata processing delay statistic method for distributed file system
CN106815045A (en) * 2016-12-19 2017-06-09 苏州唐氏机械制造有限公司 The method that versions of data updates
CN107169016A (en) * 2017-03-31 2017-09-15 北京奇艺世纪科技有限公司 A kind of application log acquisition method and device

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102054036A (en) * 2010-12-29 2011-05-11 北京新媒传信科技有限公司 File synchronizing method and device
CN102054036B (en) * 2010-12-29 2013-04-17 北京新媒传信科技有限公司 File synchronizing method and device
CN103309792A (en) * 2012-03-12 2013-09-18 联想(北京)有限公司 Method and system for controlling log information
CN103309792B (en) * 2012-03-12 2016-03-30 联想(北京)有限公司 A kind of control method of log information and system
CN104714878A (en) * 2013-12-11 2015-06-17 阿里巴巴集团控股有限公司 Method and device for collecting log data
CN105279239A (en) * 2015-09-28 2016-01-27 浪潮(北京)电子信息产业有限公司 Metadata processing delay statistic method for distributed file system
CN106815045A (en) * 2016-12-19 2017-06-09 苏州唐氏机械制造有限公司 The method that versions of data updates
CN107169016A (en) * 2017-03-31 2017-09-15 北京奇艺世纪科技有限公司 A kind of application log acquisition method and device
CN107169016B (en) * 2017-03-31 2020-01-10 北京奇艺世纪科技有限公司 Application program log acquisition method and device

Similar Documents

Publication Publication Date Title
CN101561807A (en) Method for recording logs with file by flexibly planning catalog
CN107958082B (en) Off-line increment synchronization method and system from database to data warehouse
WO2007139718A3 (en) System and method for backing up medical records
CN102360410B (en) User operation discovery method of file system and synchronous system utilizing the same
WO2008149552A1 (en) Database contradiction solution method
WO2007082314A3 (en) Digital content metadata registry systems and methods
WO2008080143A3 (en) Method and system for searching stored data
EP1359518A3 (en) Pre-loading content to caches for information appliances
CN103179185A (en) Method and system for creating files in cache of distributed file system client
WO2008057528A3 (en) A system and method for managing data across multiple environments
CN101369283A (en) Data synchronization method and system for internal memory database physical data base
WO2001097071A3 (en) File system for distributing content in a data network and related method
WO2013143393A1 (en) Method and system utilizing cloud computation for scanning files of device
EP1653360A3 (en) Recovery operations in storage networks
CN107256182A (en) A kind of method and apparatus of database restoration
US8379496B2 (en) Recording device, recording method and program
WO2006018683A3 (en) Flash file system management
US20120173834A1 (en) Managing data across a plurality of data storage devices based upon collaboration relevance
CN107402870A (en) The processing method and processing device of daily record section in a kind of meta data server
CN101557390A (en) Method for improving system performance by flexibly using cache technology
CN102075670B (en) Log recording method and device for broadcast machine
CN107291881A (en) Massive logs storage and querying method based on HBase
CN106776125A (en) It is a kind of to realize the method and device that pc client software is repaired in real time
WO2006130227A3 (en) Operating system shell management of video files
CN110471796B (en) File directory-oriented full and incremental backup recovery method

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C02 Deemed withdrawal of patent application after publication (patent law 2001)
WD01 Invention patent application deemed withdrawn after publication

Open date: 20091021