CN103944761B - Android log informations filter method and system - Google Patents
Android log informations filter method and system Download PDFInfo
- Publication number
- CN103944761B CN103944761B CN201410157526.0A CN201410157526A CN103944761B CN 103944761 B CN103944761 B CN 103944761B CN 201410157526 A CN201410157526 A CN 201410157526A CN 103944761 B CN103944761 B CN 103944761B
- Authority
- CN
- China
- Prior art keywords
- title
- daily record
- module
- log information
- information
- 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
Links
Abstract
The present invention relates to journaling techniques, there is provided a kind of Android log informations filter method and system.This method includes:Each layer original log information of modification system makes it possess user-defined format, filtering log information, and the user-defined format includes the keyword with layer title, module title, functional based method title and status information.The system includes:It is set to possess the daily record custom block of user-defined format and daily record filtering module for filtering log information for changing each layer original log information of system.The present invention is by changing each layer original log information of system, it is set to possess the user-defined format for including the keyword with layer title, module title, functional based method title and status information, log information is more accurately filtered so as to realize, reduce exploitation and the workload of tester, improve operating efficiency.
Description
Technical field
The present invention relates to journaling techniques, more particularly to Android log informations filter method and system.
Background technology
System journal is used for the event that each hardware, software are occurred in record system, and the abnormal information in running.
During system testing, it is abnormal that exploitation and tester can utilize above-mentioned log information to search, and misarrangement is carried out for system, with up to
To the purpose for continuing to optimize systematic function.But because system journal not only includes abnormal information, it further comprises correct debugging
Information, information content is huge, therefore usually needs by instrument to improve efficiency.
For android system, generally use adb logcat orders, output or preservation daily record hereof, pass through ginseng
Number is set, and filters out specific log information.
Although adb logcat orders possess the function of filtering log information, on the one hand, due to only being wrapped in journal format
The daily record rank (including error level, debugging level, warning level and detail level) of module title and module is included, because
This, when being filtered to log information, can only use module title or daily record rank to limit the output result of daily record, filtering side
Formula is limited, and the result filtered out is not accurate enough, it is often necessary to which further manual screening is to obtain required result;Meanwhile daily record
, the ambiguous problem of positioning be present, accurately to be found by the abnormal information filtered out in code position corresponding to not provided in information
, it is necessary to expend considerable time and effort, efficiency is low for the position occurred extremely in code.
On the other hand, adb logcat orders acquiescence can only print system journal outside linux kernel daily record, and for
Linux kernel daily record, then need to be printed by the dmesg orders provided in linux kernel.That is for system
The printing of different layers daily record is, it is necessary to which separated processing, virtually adds the workload that daily record is searched in manual search.Simultaneously because
Filtering function is not supported in dmesg orders, therefore the information that needs are searched in linux kernel daily record can only pass through manual search
The mode of lookup, efficiency are low.
The content of the invention
The technical problem to be solved in the present invention is:A kind of Android log informations filter method and system are provided, can be right
Log information carries out finer filtering, obtains more accurate result.
Further technical problems to be solved are the present invention:This method and system can be accurately positioned generation by abnormal information
There is abnormal position in code.
The technical problem that also further to solve of the present invention is:This method and system can be realized to system different layers daily record
The unified management of information.
In order to solve the above technical problems, the present invention provides a kind of filter method of Android log informations, including:
Each layer original log information of modification system, makes it possess user-defined format;
Filtering log information;
The user-defined format includes the keyword with layer title, module title, functional based method title and status information.
Further, the user-defined format also includes the key with the line number corresponding to file name and functional based method
Word.
Further, the step of filtering log information includes:
Daily record configuration information is set;
Capture log information;
The log information of capture is matched with configuration information;
The result for meeting matching condition is recorded.
Further, the step of setting daily record configuration information is included to layer title, module title, functional based method
The keyword of title and status information is configured.
Further, the step of capture log information includes:To the linux kernel printed out through dmesg orders
Daily record and the other systems daily record printed out through adb logcat orders are captured.
Further, this method also includes:
The one form switching switch for being used to make log information between unprocessed form and user-defined format switch is set.
Present invention simultaneously provides a kind of filtration system of Android log informations, including:
For changing each layer original log information of system, it is set to possess the daily record custom block of user-defined format;
And the daily record filtering module for filtering log information.
Further, the daily record filtering module includes:
For setting the daily record configuration module of daily record configuration information;
For capturing the daily record trapping module of log information;
The log matches module matched for the log information to capture with daily record configuration information;
And the logger module for being recorded to the result for meeting matching condition.
Further, the daily record trapping module is integrated with dmesg and adb logcat orders.
Further, the system also includes being used to make the lattice that log information switches between unprocessed form and user-defined format
Formula switching switch.
Compared with prior art, the present invention makes it possess including with layer by changing each layer original log information of system
Title, module title, functional based method title and status information keyword user-defined format, so as to realize to log information more
Fine filtering, more accurate result is obtained, reduce exploitation and the workload of tester;By being wrapped in log information
The line number corresponding to functional based method contained, it can accurately find and occur abnormal position in code, so as to improve exploitation and survey
The operating efficiency of examination personnel;By integrating dmesg, adb logcat orders realization is managed to the unified of system different layers log information
Reason.
Brief description of the drawings
Fig. 1 is the schematic diagram of log information filtration system of the present invention;
Fig. 2 is log matches module workflow schematic diagram of the present invention;
Fig. 3 is the schematic flow sheet of log information filter method of the present invention.
Embodiment
With reference to specification drawings and specific embodiments, the invention will be further described.
As shown in figure 1, the log information filtration system of the present invention includes:For changing each layer original log information of system,
It is set to possess the daily record custom block 1 of user-defined format and the daily record filtering module 2 for filtering log information.
First against the problem of existing filter type is limited, filter result is not accurate enough, to original log information in each layer
Modify, self-defined each layer journal format of system, log information is included layer title, module title, file name, function side
The keywords such as line number and status information corresponding to legitimate name, functional based method, its middle level title are included from the bottom to the superiors
Inner nuclear layer, hal layers, jni native layers and java layers, status information includes correct, mistake and alarm condition.Daily record is believed
Breath is when being filtered, the key with layer title, module title, functional based method title and status information included by it
Word, you can obtain including the information of special key words;Such as want to obtain certain specific letter in certain particular module needed for system testing
Several abnormal informations, then can be by setting layer residing for the entitled module of layer, the entitled particular module name of setup module
, to set the entitled specific function title of functional based method and set status information be referred to as error condition, to log information progress
Filtering;Because journal format is refined to module title and functional based method title, therefore the more existing mistake of result that this kind of mode filters
The result that filter mode filters is more accurate.Further, there is file name and functional based method by what log information was included
The keyword of corresponding line number, you can determine occur abnormal accurate location in code, and no longer need to search manually, improve
Operating efficiency.
During self-defined journal format, be also provided with one be used for make log information unprocessed form with it is self-defined
The form switching switch switched between form, to ensure that the log information of unprocessed form can be called when needing.It has
It is by setting a configuration parameter specified that body, which is realized, for example, when it is true to set the parameter, exports original log, no
Then filtering log.
Input of the log information as daily record filtering module 2 after user-defined format, is united by it to log information
One management.As shown in figure 1, daily record filtering module 2 includes:For setting the daily record configuration module 3 of daily record configuration information, for catching
Obtain daily record trapping module 4, the log matches mould matched for the log information to capture with configuration information of log information
Block 5, for the logger module 6 recorded to the result for meeting matching condition and the log information for exporting
Journal output module 7.
Daily record configuration module 3 is configured to daily record configuration information, that is, has layer to required particular log information
Title, module title, the keyword of functional based method title and status information are configured, such as require to look up the exception of hal layers
Log information, then it is error condition to set the entitled hal layers of daily record layer, set stl status information.
Daily record trapping module 4 is integrated with dmesg orders and adb logcat orders, to what is printed out through dmesg orders
Linux kernel daily record and the other systems daily record printed out through adb logcat orders are captured.
Log matches module 5 is caught according to configuration information set in daily record configuration module 3 to daily record trapping module 4
The log information obtained is matched step by step one by one.Its specific matching process as shown in Fig. 2 read a log information, according to
Confidence breath carries out layer matching to the log information, and layer title that will be in layer title and the configuration information of this log information is carried out
Contrast;If layer name-matches, continue module matching, otherwise return and read next log information;If daily record is matched somebody with somebody
Put in module 3 and layer title is not configured, then need not carry out layer matching, directly carry out module matching.By that analogy, until according to
This log information is matched step by step finished according to the order of layer, module, functional based method and status information, if this daily record
Each keyword matches with configuration information, then it is recorded by logger module 6, and passes through journal output module 7
Notify user.By above matching process, exploitation and tester can be filtered out comprising certain layer and module, or even certain party
The log information of method and state, the afterwards row according to corresponding to keyed file and functional based method included in log information
Number, you can there is abnormal position in accurate find in code, the operating efficiency improved.
With reference to figure 3, for the flow chart of log information filter method of the present invention, comprise the following steps:
S101, each layer original log information of system is changed, it is possessed user-defined format, wherein user-defined format includes tool
There is the keyword of a layer title, module title, functional based method title and status information, to realize to the more accurate mistake of log information
Filter;The user-defined format can further include the keyword with the line number corresponding to file name and functional based method, with
Just determine abnormal accurate location occur in code.
S102, daily record configuration information is set;
S103, capture log information;
S104, the log information of capture is matched with configuration information;
S105, the result for meeting matching condition is recorded.
Claims (10)
- A kind of 1. filter method of Android log informations, it is characterised in that including:Each layer original log information of modification system, it is possessed user-defined format, the user-defined format include with layer title, The keyword of module title, functional based method title and status information;According to the keyword with layer title, module title, functional based method title and status information come filtering log information.
- 2. according to the method for claim 1, it is characterised in that the user-defined format also includes having file name and letter The keyword of line number corresponding to counting method.
- 3. method according to claim 1 or 2, it is characterised in that include the step of the filtering log information:Daily record configuration information is set;Capture log information;The log information of capture is matched with configuration information;The result for meeting matching condition is recorded.
- 4. according to the method for claim 3, it is characterised in that it is described setting daily record configuration information the step of include to Layer title, module title, the keyword of functional based method title and status information are configured.
- 5. according to the method for claim 3, it is characterised in that described the step of capturing log information includes:To through dmesg The other systems daily record ordered the linux kernel daily record of printout and printed out through adb logcat orders is grabbed Take.
- 6. method according to claim 1 or 2, it is characterised in that this method also includes:The one form switching switch for being used to make log information between unprocessed form and user-defined format switch is set.
- A kind of 7. filtration system of Android log informations, it is characterised in that including:For changing each layer original log information of system, it is set to possess the daily record custom block of user-defined format, it is described to make by oneself Adopted form includes the keyword with layer title, module title, functional based method title and status information;And for filtering day according to the keyword with layer title, module title, functional based method title and status information The daily record filtering module of will information.
- 8. system according to claim 7, it is characterised in that the daily record filtering module includes:For setting the daily record configuration module of daily record configuration information;For capturing the daily record trapping module of log information;The log matches module matched for the log information to capture with daily record configuration information;And the logger module for being recorded to the result for meeting matching condition.
- 9. system according to claim 8, it is characterised in that the daily record trapping module is integrated with dmesg and adb Logcat orders.
- 10. according to the system described in claim 7 or 8 or 9, it is characterised in that the system also includes being used to make log information exist The form switching switch switched between unprocessed form and user-defined format.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201410157526.0A CN103944761B (en) | 2014-04-18 | 2014-04-18 | Android log informations filter method and system |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201410157526.0A CN103944761B (en) | 2014-04-18 | 2014-04-18 | Android log informations filter method and system |
Publications (2)
Publication Number | Publication Date |
---|---|
CN103944761A CN103944761A (en) | 2014-07-23 |
CN103944761B true CN103944761B (en) | 2018-01-26 |
Family
ID=51192258
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201410157526.0A Active CN103944761B (en) | 2014-04-18 | 2014-04-18 | Android log informations filter method and system |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN103944761B (en) |
Families Citing this family (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106209405B (en) * | 2015-05-06 | 2019-11-08 | 中国移动通信集团内蒙古有限公司 | Method for diagnosing faults and device |
CN105138606A (en) * | 2015-08-03 | 2015-12-09 | 上海斐讯数据通信技术有限公司 | Server log management method and system |
CN106294723A (en) * | 2016-08-10 | 2017-01-04 | 成都广达新网科技股份有限公司 | A kind of apply in the quick inspection method of system journal of embedded device and system |
CN109905253B (en) * | 2017-12-07 | 2022-05-17 | 航天信息股份有限公司 | Log information acquisition method and device |
CN108519923A (en) * | 2018-03-01 | 2018-09-11 | 北京三快在线科技有限公司 | A kind of interim card detection method and device and electronic equipment |
CN109088859B (en) * | 2018-07-16 | 2021-07-20 | 北京奇虎科技有限公司 | Method, device, server and readable storage medium for identifying suspicious target object |
CN109213660A (en) * | 2018-08-28 | 2019-01-15 | 郑州云海信息技术有限公司 | A kind of log-output method and device based on filter condition |
CN113221101A (en) * | 2021-04-06 | 2021-08-06 | 中标软件有限公司 | Method for realizing safety audit function based on android system |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101093514A (en) * | 2007-08-20 | 2007-12-26 | 中兴通讯股份有限公司 | Processing system for automated testing log |
CN101291256A (en) * | 2008-06-02 | 2008-10-22 | 杭州华三通信技术有限公司 | Method and system for upgrading system log to alarm |
CN101414255A (en) * | 2007-10-19 | 2009-04-22 | 国际商业机器公司 | Method and apparatus for processing log event |
CN103544298A (en) * | 2013-10-30 | 2014-01-29 | 曙光信息产业(北京)有限公司 | Log analysis method and analysis device for component |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US9020463B2 (en) * | 2011-12-29 | 2015-04-28 | The Nielsen Company (Us), Llc | Systems, methods, apparatus, and articles of manufacture to measure mobile device usage |
-
2014
- 2014-04-18 CN CN201410157526.0A patent/CN103944761B/en active Active
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101093514A (en) * | 2007-08-20 | 2007-12-26 | 中兴通讯股份有限公司 | Processing system for automated testing log |
CN101414255A (en) * | 2007-10-19 | 2009-04-22 | 国际商业机器公司 | Method and apparatus for processing log event |
CN101291256A (en) * | 2008-06-02 | 2008-10-22 | 杭州华三通信技术有限公司 | Method and system for upgrading system log to alarm |
CN103544298A (en) * | 2013-10-30 | 2014-01-29 | 曙光信息产业(北京)有限公司 | Log analysis method and analysis device for component |
Non-Patent Citations (1)
Title |
---|
《用静态信息流分析检测Android应用中的日志隐患》;彭智俊;《小型微型计算机系统》;20130630;全文 * |
Also Published As
Publication number | Publication date |
---|---|
CN103944761A (en) | 2014-07-23 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN103944761B (en) | Android log informations filter method and system | |
CN107832196A (en) | A kind of monitoring device and monitoring method for real-time logs anomalous content | |
CN102340415B (en) | Server cluster system and monitoring method thereof | |
CN109284251A (en) | Blog management method, device, computer equipment and storage medium | |
CN104794136A (en) | Fault analysis method and device | |
CN106778873A (en) | A kind of warning information classification method of disposal and device based on white list rule | |
CN106254109A (en) | Log collection method, Log Collect System and server | |
CN105389314B (en) | A kind of journal file inquiry system and querying method | |
CN107181604A (en) | A kind of generation method, alarm compression method and the device of alarm association rule | |
CN106169959A (en) | A kind of log processing device | |
CN105915381A (en) | System for realizing monitoring system business logic online modification | |
CN106250287A (en) | A kind of log information processing means | |
CN111258722A (en) | Cluster log acquisition method, system, device and medium | |
CN104020729A (en) | System and method for event logging in technical installation or technical process | |
CN105187241A (en) | Log recording method and system based on linux kernel | |
CN102073579A (en) | Method for merging and optimizing audit events of Linux file system | |
CN106708965A (en) | Data processing method and apparatus | |
CN109660407A (en) | Distributed system monitoring system and method | |
CN109782982A (en) | A kind of processing method and terminal reading log | |
KR101510647B1 (en) | Method and apparatus for providing web trend analysis based on issue template extraction | |
CN104933077B (en) | Rule-based multifile information analysis method | |
CN103400239B (en) | A kind of typography quality monitoring method and system based on RFID technique | |
CN106250405A (en) | A kind of magnanimity information processing system | |
DE102010028152B4 (en) | Recording history information in a field device | |
US20190340540A1 (en) | Adaptive continuous log model learning |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |