CN106201844A - A kind of log collecting method and device - Google Patents

A kind of log collecting method and device Download PDF

Info

Publication number
CN106201844A
CN106201844A CN201610498825.XA CN201610498825A CN106201844A CN 106201844 A CN106201844 A CN 106201844A CN 201610498825 A CN201610498825 A CN 201610498825A CN 106201844 A CN106201844 A CN 106201844A
Authority
CN
China
Prior art keywords
log
collection
terminal
logs
output level
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.)
Granted
Application number
CN201610498825.XA
Other languages
Chinese (zh)
Other versions
CN106201844B (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.)
Beijing Rubu Technology Co ltd
Original Assignee
Beijing Intelligent Housekeeper 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 Intelligent Housekeeper Technology Co Ltd filed Critical Beijing Intelligent Housekeeper Technology Co Ltd
Priority to CN201610498825.XA priority Critical patent/CN106201844B/en
Publication of CN106201844A publication Critical patent/CN106201844A/en
Application granted granted Critical
Publication of CN106201844B publication Critical patent/CN106201844B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

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/3495Performance evaluation by tracing or monitoring for systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/3003Monitoring arrangements specially adapted to the computing system or computing system component being monitored
    • G06F11/3013Monitoring arrangements specially adapted to the computing system or computing system component being monitored where the computing system is an embedded system, i.e. a combination of hardware and software dedicated to perform a certain function in mobile devices, printers, automotive or aircraft systems

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Computing Systems (AREA)
  • Quality & Reliability (AREA)
  • General Physics & Mathematics (AREA)
  • Mathematical Physics (AREA)
  • Computer Hardware Design (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The embodiment of the invention discloses a kind of log collecting method and device, described method includes: judge whether to be collected the corresponding daily record of terminal applies service;If desired it is collected, it is determined that the output level of the most corresponding log collection of intended application service being collected;Send to terminal to collect and preset the log collection instruction that output level is corresponding;Receive the corresponding daily record of the described default output level of the described intended application service that described terminal sends respectively.Described device includes that log collection determines that module, output level determine module, instruction sending module and daily record receiver module.The embodiment of the present invention judges to determine whether to carry out log collection by server, it is possible to realize the active collection of server, it is to avoid log collection triggers single problem;Different daily records is collected, it is possible to meet the requirement of the on-demand collection of user, avoid the problem that log collection is the most complete simultaneously by output level.

Description

Log collection method and device
Technical Field
The embodiment of the invention relates to the technical field of Internet, in particular to a log collection method and device.
Background
Along with the continuous perfection of the functions of the intelligent robot, the intelligent degree of the intelligent robot is continuously improved, more and more intelligent robots begin to enter common families, for example, sweeping robots, house-keeping robots and the like, and the intelligent robot brings great convenience to the life of people. However, in order to understand the operation state of the intelligent robot and timely find out the faults and problems existing in the operation process, it is necessary to collect log information in the operation process of the intelligent robot to help analyze whether the functions of the intelligent robot are completed correctly and the conditions of various parameter indexes.
The current intelligent robot can not touch a mobile phone, a tablet and other intelligent terminals with display screens conveniently, or a user can directly trigger collection of logs like a wearable intelligent device. At present, an intelligent robot on the market has single triggering logic, incomplete log collection and unstable result, so that the function cannot be diagnosed effectively through logs. Meanwhile, the abnormal information of the section can be submitted only passively when the program crashes, and once the program runs fast, the system can be automatically cleaned and started, and the probability that the program can finish the log collection work is very low.
In the process of implementing the embodiment of the invention, the inventor finds that the existing log collection method of the intelligent robot only triggers log collection after a program runs, so that the log collection is incomplete, and meanwhile, the logs cannot be actively collected as required.
Disclosure of Invention
The invention provides a log collection method and device, and aims to solve the problems that the existing log collection method of an intelligent robot triggers log collection only after a program runs, so that the log collection is incomplete, and meanwhile, logs cannot be collected actively according to needs.
In a first aspect, an embodiment of the present invention provides a log collection method, including:
judging whether to collect corresponding logs of the terminal application service;
if the collection is needed, determining the output levels of the collected target application services corresponding to the log collection respectively;
sending a log collection instruction corresponding to a collection preset output level to a terminal;
and respectively receiving the corresponding logs of the preset output level of the target application service, which are sent by the terminal.
Preferably, the determining whether to collect a log corresponding to the terminal application service further includes:
and the server judges whether to collect the corresponding logs of the application service installed on the terminal according to the current time, the current place, the current network condition and the server memory condition.
Preferably, the determining that the target application services for collection respectively correspond to output levels of log collection further includes:
and determining output levels of log collection respectively corresponding to the target application services according to the log states and the fault repairing states.
Preferably, the receiving the logs corresponding to the preset output levels of the target application service and sent by the terminal respectively further includes:
and receiving the corresponding log of the preset output level of the target application service sent by the terminal by the fragments.
Preferably, the method further comprises:
and storing the log corresponding to the preset output level into the preset file according to the preset file address.
Preferably, according to the preset file address, the method further comprises:
and analyzing the logs stored in the preset file, and generating and displaying an analysis result.
According to the technical scheme, the log collection method provided by the embodiment of the invention judges and determines whether to collect the logs through the server, so that the active collection of the server can be realized, and the problem of single trigger of the log collection is avoided; different logs are collected through the output levels, the requirement of the user for collecting logs according to needs can be met, and meanwhile the problem of incomplete log collection is avoided.
In a second aspect, an embodiment of the present invention further provides a log collecting apparatus, including:
the log collection determining module is used for judging whether to collect logs corresponding to the terminal application service;
the output level determining module is used for determining output levels of the collected target application services corresponding to the log collection respectively if the collection is needed;
the instruction sending module is used for sending a log collection instruction corresponding to the collection preset output level to the terminal;
and the log receiving module is used for respectively receiving the logs corresponding to the preset output levels of the target application service and sent by the terminal.
Preferably, the log collection determining module is further configured to determine whether to collect a log corresponding to the application service installed in the terminal according to the current time, the current location, the current network condition, and the server memory condition.
Preferably, the output level determining module is further configured to determine, according to the log status and the failure recovery status, output levels of log collection respectively corresponding to the target application service.
Preferably, the log receiving module is further configured to receive, in a fragmented manner, logs corresponding to the preset output level of the target application service and sent by the terminal.
Preferably, the apparatus further comprises:
and the storage module is used for storing the log corresponding to the preset output level into the preset file according to a preset file address.
Preferably, the apparatus further comprises:
and the log analysis module is used for analyzing the logs stored in the preset file, generating an analysis result and displaying the analysis result.
According to the technical scheme, the log collection device provided by the embodiment of the invention judges and determines whether to collect the logs through the server, so that the active collection of the server can be realized, and the problem of single trigger of the log collection is avoided; different logs are collected through the output levels, the requirement of the user for collecting logs according to needs can be met, and meanwhile the problem of incomplete log collection is avoided.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to these drawings without creative efforts.
Fig. 1 is a schematic flowchart of a log collection method according to an embodiment of the present invention;
fig. 2 is a schematic flowchart of a log collection method according to another embodiment of the present invention;
fig. 3 is a flowchart illustrating a log collection method according to another embodiment of the present invention;
fig. 4 is a schematic structural diagram of a log collection device according to an embodiment of the present invention.
Detailed Description
The following further describes embodiments of the invention with reference to the drawings. The following examples are only for illustrating the technical solutions of the present invention more clearly, and the protection scope of the present invention is not limited thereby.
Fig. 1 is a flowchart illustrating a log collection method according to an embodiment of the present invention, including:
s101, judging whether a corresponding log of the terminal application service is collected or not;
the server can actively collect logs corresponding to the terminal application service according to the judgment rule; the decision rule may be: according to the daily work schedule of the intelligent robot, selecting the idle time of the intelligent robot to collect logs so as not to influence the daily work efficiency of the intelligent robot; or according to the current network condition of the server, collecting logs when the network speed is high; or according to the current memory condition of the server, when the idle memory is larger than the threshold value, collecting the logs.
Or, the server may determine whether to collect logs of each application service of the terminal according to the monitoring file sent by the terminal. Specifically, the terminal side comprises a monitoring service for monitoring the service state of each application; the monitoring service acquires the state of each application service and uploads a monitoring file to the server according to a preset time interval, wherein the monitoring file comprises the running state of each application service. Specifically, on the terminal side, a plurality of application services are included, each application service corresponding to one or more log files.
By judging and determining whether to perform log collection on the corresponding log of the terminal application service, the switch for log collection can be dynamically controlled. Therefore, the output and the closing of the log can be flexibly controlled, so that complete log data can be collected for subsequent analysis while no extra performance is consumed; meanwhile, a collection instruction is initiatively initiated through the server, intelligent analysis, judgment and collection are carried out, and the traditional passive collapse collection mode is broken through, so that the collection mode is flexible and changeable, and meanwhile, the fault diagnosis of the intelligent robot is more comprehensive.
S102, if collection is needed, determining output levels of collected target application services corresponding to log collection respectively;
specifically, the output level of log collection corresponding to each application service is judged and determined according to a preset rule.
For example, the preset rule may be severity of the fault, such as light fault, moderate fault, and heavy fault; alternatively, the repair time for the failure, such as 1 minute, 10 minutes, 30 minutes, 3 hours, and 2 days; or, the setting can be preset according to the specific requirements of the user.
The output levels are different output requirements corresponding to each log file, and represent abnormal levels generated when corresponding application service runs.
For example, the output levels may be set from low to high as: i (info), v (verbose, display details), d (debug, repairable), w (war), and e (error). Wherein, i represents a log for only informing a user of an error, the abnormal level is the lowest, v represents a detailed information log for sending the error to the user, d represents an error log for informing the user that the error is repairable, w represents an error log for warning the user to pay attention to, e represents a fault log for sending the user, and the abnormal level is the highest.
Or the output level can be represented by 1-5 levels, and the output level is 1 level, which represents the logs of the important function module and the logs of the function module with faults, and the logs needing to be uploaded in real time; outputting logs with 2-level output levels representing the secondary function modules, and uploading the logs according to the instructions of the server; and the output level is 3 levels, the logs represent common functional modules, and the logs are uploaded according to the instructions of the server. When the output level of the log file M is 2 levels and the functional module corresponding to the log file M does not have a fault, the log file M is uploaded to the server when the server sends an upload 2-level log to the intelligent robot.
Alternatively, the output level may be defined according to the specific requirements of the user.
Specifically, at the intelligent robot end, the following steps need to be performed:
a1, establishing monitoring service objects installed on a terminal at an intelligent robot end, and respectively acquiring instances of the monitoring service objects according to the monitoring service objects at main entrances of the application services by each application service, so as to judge whether log collection is performed on the application services;
a2, initializing an object, and respectively calling an initialization method to initialize after each application service acquires the object instance of the monitoring service;
in step a2, each application service receives a monitoring service object instance, and controls whether the LOG recorded by itself should be output to the console of the terminal according to the LOG _ ENABLED and DEBUG flag DEBUG attribute defined in the monitoring service object instance. The collection allowing switch and the debugging mark are both bolean type data, the collection allowing switch LOG _ ENABLED represents whether the intelligent robot end allows a server to collect a switch of a LOG, and the collection allowing switch is in a closed state under the default condition so as to prevent illegal collection of malicious programs; when the server judges that log collection is needed, the collection allowing switch is changed into an open state; the debugging mark is a mark which is set for facilitating debugging access in the debugging process. And meanwhile, the detection service object instance also registers a self-defined broadcast receiver, and the broadcast receiver is responsible for responding to the command, controlling the log switch and starting the service for collecting log information for collecting and uploading the log.
A3, outputting logs, wherein each application service calls an output level method by using the initialized monitoring service object instance, and outputs log information of different levels to a console; the output level method can be customized by a user according to specific requirements.
In the step A3, a new functional package is added, so that the scheme of the native system is enhanced, the native system is more convenient to use, but the code design style of the original Google is not changed, and the program is free from obstacles when being called. In addition, the definition in step A3 has a log level of operation, which is the minimum level minLevel and the maximum level maxLevel, respectively, and a mandatory output parameter, which may break the limitation in step a 2. Specifically, when the forced output is set in step A3, the output is performed at the minimum level and the maximum level in step A3 regardless of the restriction condition of step a 2. For example, when the minimum level of forced output is 2 and the maximum level is 4, the logs with output levels of 2, 3 and 4 are uploaded to the server.
For example,
b1, the Application service acquires the instance of the monitoring service object at the main entrance through logcat. getinstant (String tag), the log collection must be placed at the entrance, the best implementation scheme is to place in the custom Application, and the instantiation of the monitoring service object runs as early as possible. Each LogCat is provided with a designated tag when being instantiated, so that filtering logs can be distinguished conveniently;
b2, after the object instance of the monitoring service is obtained, invoking an init (context) method to initialize the object instance. The initialization of the step is to make default configuration for the created LogCat object, and a control mechanism and an anti-control mechanism are arranged in the LogCat object, so that the encapsulation enables the internal complex mechanism to be simple and concise to call.
B3, calling logCat.i (StringclassName, Stringmsg) and logCat.i (StringclassName, Stringmsg, coolean isOut, StringfileName) and the like, corresponding to the corresponding log levels, according with the log level rule defined by Android, enabling the isOut parameter to break through the whole log switch mechanism, and enabling fileName to specify the local file of the saved log, wherein the log is flexible and changeable.
By controlling the grade of log collection, the problem of difficult analysis caused by huge logs can be solved; uploading is carried out in the range of the designated level, only logs concerned by the user can be analyzed, the analysis time is shortened, and faults and problems are quickly located.
S103, sending a log collection instruction corresponding to a collection preset output level to the terminal;
wherein, the preset output level can be preset according to the requirement of a user.
Specifically, the server can actively control to start the collection service through a reserved background port; and after the collection service is started, the server sends a collection instruction for collecting the logs corresponding to the preset output level to the terminal.
And the collection instruction comprises a preset output level of the log.
For example, if the server sends a log with a collection output level less than 3 to the terminal, the terminal needs to upload logs with output levels 1 and 2 to the server. Wherein, the terminal can be an intelligent robot.
S104, receiving the corresponding logs of the preset output level of the target application service sent by the terminal respectively.
Specifically, after the server sends a collection instruction for collecting the log corresponding to the preset output level to the terminal, at the terminal side, the specific steps include:
first, the collection permission switch is turned on;
then according to the output level of the log in the collection instruction, searching the log corresponding to the output level;
and finally, packaging and uploading the log corresponding to the output level to the server.
And on the side of the server, after uploading the packaged log, the terminal receives the log corresponding to the preset output level.
According to the embodiment, the server judges whether to perform log collection or not, active collection of the server can be realized, and the problem of single trigger of log collection is avoided; different logs are collected through the output levels, the requirement of the user for collecting logs according to needs can be met, and meanwhile the problem of incomplete log collection is avoided.
Further, on the basis of the above method embodiment, S101 further includes:
and the server judges whether to collect the corresponding logs of the application service installed on the terminal according to the current time, the current place, the current network condition and the server memory condition.
Specifically, whether to collect the log of the application service installed in the terminal can be determined by adopting a network long link keep-alive technology, a heartbeat sending detection technology and a comprehensive system condition analysis decision. Wherein the network long link keep-alive technique represents maintaining a long and stable connection of the network; the heartbeat sending detection technology indicates that a notice is sent to a server after a preset time interval to inform that the heartbeat sending detection technology is running; the comprehensive system condition analysis decision represents that the total sum considers a plurality of factors for analysis, for example, whether intelligent log collection needs to be started is judged according to combination of various factors such as the current time, the current location, the current network condition, the current interaction condition, the server memory condition, the overall system operation condition and the like.
For example, the server selects a trigger for collection, such as: and calling a startSave method, sending an instruction by a server to start a diagnosis function, wherein a specific collection command is served in another independent process, and the process is responsible for log collection and packaging uploading, does not participate in other services, and ensures the safety.
Whether log collection is carried out or not is judged through the current specific parameters, and the log collection can be carried out by combining the current specific conditions so as not to influence the daily work of the intelligent robot and improve the efficiency of the log collection.
Further, on the basis of the above embodiment of the method, S102 further includes:
and determining output levels of log collection respectively corresponding to the target application services according to the log states and the fault repairing states.
Specifically, the log state refers to the current operating state of the log, such as whether the log is being updated; the failure modification state refers to a state after the logged application program fails, such as whether the application program is repaired or not.
When the log is in an updating state, the output level of the log can be set to be a lower level so as to prevent the problem of incomplete data caused by uploading the log in the log updating process.
When the application program recorded by the log is repaired after the fault occurs, the log can be set to be at the next highest level so as to upload the log to the server as early as possible; when the log recorded by the application program is not repaired after the fault occurs, the log can be set to the highest level, and the log can be uploaded to the server.
Further, on the basis of the above embodiment of the method, S104 further includes:
and receiving the corresponding log of the preset output level of the target application service sent by the terminal by the fragments.
By adopting the log fragmentation technology, the success rate of log uploading can be improved, the bandwidth consumption is reduced, and the pressure of network transmission is reduced.
Specifically, the intelligent robot can compress and upload the logs in a slicing mode when uploading the logs.
Further, on the basis of the above embodiment of the method, as shown in fig. 2, the method includes:
s201, judging whether a corresponding log of the terminal application service is collected or not;
s202, if collection is needed, determining output levels of collected target application services corresponding to log collection respectively;
s203, sending a log collection instruction corresponding to a collection preset output level to the terminal;
s204, receiving the logs corresponding to the preset output levels of the target application service and sent by the terminal respectively.
S205, storing the log corresponding to the preset output level into the preset file according to the preset file address.
Wherein S201-S204 correspond to S101-S104 in the corresponding embodiment of FIG. 1.
The preset file address can be preset according to the specific requirements of the user.
Specifically, in S205, by setting the thread pool and the file security lock control, it is ensured that the file is correctly, safely, and efficiently written into the preset file.
Further, on the basis of the above embodiment of the method, as shown in fig. 3, the method includes:
s301, judging whether a corresponding log of the terminal application service is collected or not;
s402, if collection is needed, determining output levels of collected target application services corresponding to log collection respectively;
s303, sending a log collection instruction corresponding to a collection preset output level to the terminal;
s304, receiving the logs corresponding to the preset output levels of the target application service sent by the terminal respectively.
S305, storing the log corresponding to the preset output level into the preset file according to the preset file address.
And S306, analyzing the logs stored in the preset file, and generating and displaying an analysis result.
Wherein S301-S205 correspond to S201-S205 in the embodiment corresponding to FIG. 2.
Specifically, through analysis by the server in S306, different error codes are generated and identified, so that the user can clearly preview the data set in the background.
For example, the issue identification may include: the method is not solved, is irrelevant, is solved, cannot be solved at present, delays the solution and specially processes.
By analyzing the log, a complete and intuitive functional diagnosis result can be generated, and a developer can manage the response application service according to needs.
The embodiment divides the responsibility of the whole structural framework, controls the log switch in a dynamic mode, and collects the log information analysis and diagnosis function by using the independent process Service logcat command. The method comprises the steps that a terminal monitors the working state of each system service, and once the abnormal state is detected and reported to a server, the server actively starts to count abnormal logs corresponding to abnormal modules corresponding to the terminal and uniformly forwards the abnormal logs to a log server to generate error codes for developers to perform function diagnosis.
The embodiment can adopt the Logicat command set of the google Android system, and by combining a java thread pool, a multithreading technology, a multiprocess file safe writing technology, a file fragmentation technology and a synthesis technology, the program log collection and uploading form a perfect closed loop, so that the method has the advantages of complete information collection, stable program operation, low performance consumption and intelligent collection, and supports the response of a remote collection instruction, and has the advantages of high safety, strong expansibility, simple operability, technical expansion and continuous innovation and progressive significance.
Fig. 2 is a schematic structural diagram of a log collection apparatus according to an embodiment of the present invention, where the apparatus includes: a log collection determining module 21, an output level determining module 22, an instruction transmitting module 23 and a log receiving module 24; wherein,
the log collection determining module 21 is configured to determine whether to collect a log corresponding to a terminal application service;
the output level determining module 22 is configured to determine, if collection is needed, output levels of the collected target application services corresponding to log collection respectively;
the instruction sending module 23 is configured to send a log collection instruction corresponding to a collection preset output level to the terminal;
the log receiving module 24 is configured to receive logs corresponding to the preset output levels of the target application service and sent by the terminal, respectively.
Specifically, the log collection determining module 21 determines whether to collect a corresponding log of the terminal application service; if the output level determining module 22 needs to perform collection, it determines that the collected target application services respectively correspond to the output levels of log collection; the instruction sending module 23 sends a log collection instruction corresponding to a collection preset output level to the terminal; the log receiving module 24 respectively receives the logs corresponding to the preset output levels of the target application service, which are sent by the terminal. .
According to the embodiment, the server judges whether to perform log collection or not, active collection of the server can be realized, and the problem of single trigger of log collection is avoided; different logs are collected through the output levels, the requirement of the user for collecting logs according to needs can be met, and meanwhile the problem of incomplete log collection is avoided.
Further, on the basis of the above device embodiment, the log collection determining module 21 is further configured to determine whether to collect a log corresponding to an application service installed in the terminal according to the current time, the current location, the current network condition, and the server memory condition.
Further, on the basis of the above apparatus embodiment, the output level determining module 22 is further configured to determine, according to the log status and the failure recovery status, the output levels of the log collections respectively corresponding to the target application services.
Further, on the basis of the above apparatus embodiment, the log receiving module 24 is further configured to receive, in a fragmented manner, the logs corresponding to the preset output level of the target application service and sent by the terminal.
Further, on the basis of the above embodiment of the apparatus, the apparatus further comprises:
and the storage module 25 is configured to store the log corresponding to the output level into the preset file according to a preset file address.
Further, on the basis of the above embodiment of the apparatus, the apparatus further comprises:
and the log analysis module 26 is configured to analyze the logs stored in the preset file, generate an analysis result, and display the analysis result.
The log collection device described in this embodiment may be used to implement the above method embodiments, and the principle and technical effect are similar, which are not described herein again.
The above-described embodiments of the apparatus are merely illustrative, and the units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment. One of ordinary skill in the art can understand and implement it without inventive effort.
Through the above description of the embodiments, those skilled in the art will clearly understand that each embodiment can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware. With this understanding in mind, the above-described technical solutions may be embodied in the form of a software product, which can be stored in a computer-readable storage medium such as ROM/RAM, magnetic disk, optical disk, etc., and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the methods described in the embodiments or some parts of the embodiments.
It should be noted that: the above examples are only intended to illustrate the technical solution of the present invention, but not to limit it; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present invention.

Claims (12)

1. A log collection method, comprising:
judging whether to collect corresponding logs of the terminal application service;
if the collection is needed, determining the output levels of the collected target application services corresponding to the log collection respectively;
sending a log collection instruction corresponding to a collection preset output level to a terminal;
and respectively receiving the corresponding logs of the preset output level of the target application service, which are sent by the terminal.
2. The method of claim 1, wherein the determining whether to collect corresponding logs of terminal application services further comprises:
and the server judges whether to collect the corresponding logs of the application service installed on the terminal according to the current time, the current place, the current network condition and the server memory condition.
3. The method of claim 1, wherein determining the target application services for collection respectively correspond to output levels of log collection, further comprises:
and determining output levels of log collection respectively corresponding to the target application services according to the log states and the fault repairing states.
4. The method of claim 1, wherein the receiving the corresponding logs of the preset output levels of the target application services sent by the terminal respectively further comprises:
and receiving the corresponding log of the preset output level of the target application service sent by the terminal by the fragments.
5. The method according to any one of claims 1-4, further comprising:
and storing the log corresponding to the preset output level into the preset file according to the preset file address.
6. The method of claim 5, further comprising:
and analyzing the logs stored in the preset file, and generating and displaying an analysis result.
7. A log collection apparatus, comprising:
the log collection determining module is used for judging whether to collect logs corresponding to the terminal application service;
the output level determining module is used for determining output levels of the collected target application services corresponding to the log collection respectively if the collection is needed;
the instruction sending module is used for sending a log collection instruction corresponding to the collection preset output level to the terminal;
and the log receiving module is used for respectively receiving the logs corresponding to the preset output levels of the target application service and sent by the terminal.
8. The apparatus of claim 7, wherein the log collection determining module is further configured to determine whether to collect a corresponding log of the application service installed in the terminal according to a current time, a current location, a current network condition, and a server memory condition.
9. The apparatus of claim 7, wherein the output level determining module is further configured to determine the output levels of the log collections respectively corresponding to the target application services according to the log status and the failure recovery status.
10. The apparatus of claim 7, wherein the log receiving module is further configured to receive, in a fragmented manner, corresponding logs of the preset output level of the target application service sent by the terminal.
11. The apparatus according to any one of claims 7-10, further comprising:
and the storage module is used for storing the log corresponding to the preset output level into the preset file according to a preset file address.
12. The apparatus of claim 11, further comprising:
and the log analysis module is used for analyzing the logs stored in the preset file, generating an analysis result and displaying the analysis result.
CN201610498825.XA 2016-06-29 2016-06-29 A kind of log collecting method and device Active CN106201844B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610498825.XA CN106201844B (en) 2016-06-29 2016-06-29 A kind of log collecting method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610498825.XA CN106201844B (en) 2016-06-29 2016-06-29 A kind of log collecting method and device

Publications (2)

Publication Number Publication Date
CN106201844A true CN106201844A (en) 2016-12-07
CN106201844B CN106201844B (en) 2019-01-01

Family

ID=57463498

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610498825.XA Active CN106201844B (en) 2016-06-29 2016-06-29 A kind of log collecting method and device

Country Status (1)

Country Link
CN (1) CN106201844B (en)

Cited By (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107562602A (en) * 2017-09-13 2018-01-09 广东欧珀移动通信有限公司 Log information report method, device and storage medium, ADSP and terminal
CN107590241A (en) * 2017-09-13 2018-01-16 广东欧珀移动通信有限公司 Log information report method, device and storage medium, ADSP and terminal
CN107609117A (en) * 2017-09-13 2018-01-19 广东欧珀移动通信有限公司 Log information report method, device and storage medium, ADSP and terminal
CN108011745A (en) * 2017-09-30 2018-05-08 北京车和家信息技术有限公司 The transmission method and device of data
CN109218407A (en) * 2018-08-14 2019-01-15 平安普惠企业管理有限公司 Code management-control method and terminal device based on log monitoring technology
CN109962978A (en) * 2019-02-28 2019-07-02 深圳市盛弘电气股份有限公司 Charging pile log deriving method, charging pile and control equipment
CN110413480A (en) * 2019-04-30 2019-11-05 北京云迹科技有限公司 Processing method and processing device for robot operating status
CN110928753A (en) * 2019-11-19 2020-03-27 深圳前海环融联易信息科技服务有限公司 Method and device for controlling log output of browser console, computer equipment and computer readable storage medium
CN111159127A (en) * 2018-11-07 2020-05-15 中移(苏州)软件技术有限公司 Log analysis method and device based on Apriori algorithm
CN111209023A (en) * 2020-01-08 2020-05-29 百度在线网络技术(北京)有限公司 Skill service updating method and device, electronic equipment and readable storage medium
CN112306834A (en) * 2020-10-29 2021-02-02 武汉迈威通信股份有限公司 Embedded log management system and method
CN115223269A (en) * 2021-09-06 2022-10-21 广州汽车集团股份有限公司 Automobile log uploading method and device, computer equipment and automobile

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102790686A (en) * 2011-05-17 2012-11-21 浙江核新同花顺网络信息股份有限公司 Log data collecting method and system and log collecting server
WO2013161522A1 (en) * 2012-04-24 2013-10-31 日本電気株式会社 Log collection server, log collection system, log collection method
CN103942134A (en) * 2014-04-04 2014-07-23 福建星网视易信息系统有限公司 Method and system for viewing embedded device log
CN104253704A (en) * 2013-06-28 2014-12-31 腾讯科技(深圳)有限公司 Terminal log reporting method, device and system
CN104601374A (en) * 2015-01-05 2015-05-06 北京数码大方科技股份有限公司 Network fault processing method and device for numerical control machine tool

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102790686A (en) * 2011-05-17 2012-11-21 浙江核新同花顺网络信息股份有限公司 Log data collecting method and system and log collecting server
WO2013161522A1 (en) * 2012-04-24 2013-10-31 日本電気株式会社 Log collection server, log collection system, log collection method
CN104253704A (en) * 2013-06-28 2014-12-31 腾讯科技(深圳)有限公司 Terminal log reporting method, device and system
CN103942134A (en) * 2014-04-04 2014-07-23 福建星网视易信息系统有限公司 Method and system for viewing embedded device log
CN104601374A (en) * 2015-01-05 2015-05-06 北京数码大方科技股份有限公司 Network fault processing method and device for numerical control machine tool

Cited By (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107609117B (en) * 2017-09-13 2020-09-01 Oppo广东移动通信有限公司 Log information reporting method and device, storage medium, ADSP and terminal
CN107590241A (en) * 2017-09-13 2018-01-16 广东欧珀移动通信有限公司 Log information report method, device and storage medium, ADSP and terminal
CN107609117A (en) * 2017-09-13 2018-01-19 广东欧珀移动通信有限公司 Log information report method, device and storage medium, ADSP and terminal
CN107562602A (en) * 2017-09-13 2018-01-09 广东欧珀移动通信有限公司 Log information report method, device and storage medium, ADSP and terminal
CN107562602B (en) * 2017-09-13 2021-11-16 Oppo广东移动通信有限公司 Log information reporting method and device, storage medium, ADSP and terminal
CN108011745A (en) * 2017-09-30 2018-05-08 北京车和家信息技术有限公司 The transmission method and device of data
CN109218407A (en) * 2018-08-14 2019-01-15 平安普惠企业管理有限公司 Code management-control method and terminal device based on log monitoring technology
CN109218407B (en) * 2018-08-14 2022-10-25 平安普惠企业管理有限公司 Code management and control method based on log monitoring technology and terminal equipment
CN111159127A (en) * 2018-11-07 2020-05-15 中移(苏州)软件技术有限公司 Log analysis method and device based on Apriori algorithm
CN109962978A (en) * 2019-02-28 2019-07-02 深圳市盛弘电气股份有限公司 Charging pile log deriving method, charging pile and control equipment
CN110413480A (en) * 2019-04-30 2019-11-05 北京云迹科技有限公司 Processing method and processing device for robot operating status
CN110928753A (en) * 2019-11-19 2020-03-27 深圳前海环融联易信息科技服务有限公司 Method and device for controlling log output of browser console, computer equipment and computer readable storage medium
CN111209023A (en) * 2020-01-08 2020-05-29 百度在线网络技术(北京)有限公司 Skill service updating method and device, electronic equipment and readable storage medium
CN112306834A (en) * 2020-10-29 2021-02-02 武汉迈威通信股份有限公司 Embedded log management system and method
CN115223269A (en) * 2021-09-06 2022-10-21 广州汽车集团股份有限公司 Automobile log uploading method and device, computer equipment and automobile

Also Published As

Publication number Publication date
CN106201844B (en) 2019-01-01

Similar Documents

Publication Publication Date Title
CN106201844B (en) A kind of log collecting method and device
CN106789306B (en) Method and system for detecting, collecting and recovering software fault of communication equipment
US20170300371A1 (en) KVM having Blue Screen of Death Detection and Warning Functions
US11706080B2 (en) Providing dynamic serviceability for software-defined data centers
US10545807B2 (en) Method and system for acquiring parameter sets at a preset time interval and matching parameters to obtain a fault scenario type
CN101197621B (en) Method and system for remote diagnosing and locating failure of network management system
CN109284207A (en) Hard disc failure processing method, device, server and computer-readable medium
CN111459770A (en) Server operation state warning method and device, server and storage medium
CN111966465B (en) Method, system, equipment and medium for modifying host configuration parameters in real time
CN101296135A (en) Fault information processing method and device
CN108762886B (en) Fault detection recovery method and system for virtual machine
CN105512015A (en) Android target application crash calculation method and device
CN111930703A (en) Automatic log file capturing method and device and computer equipment
CN110704228A (en) Solid state disk exception handling method and system
CN115664939A (en) Comprehensive operation and maintenance method and device based on automation technology and storage medium
CN107528705B (en) Fault processing method and device
CN105068763A (en) Virtual machine fault-tolerant system and method for storage faults
US8402125B2 (en) Method of managing operations for administration, maintenance and operational upkeep, management entity and corresponding computer program product
CN109614297A (en) Data guard method, device, equipment, system and computer readable storage medium
CN101140540A (en) Method and system for detecting automatic monitoring magnetic array
CN109144815A (en) A kind of computer glitch processing system of real-time detection
JP2010009127A (en) Management program and management device
CN112131090B (en) Service system performance monitoring method, device, equipment and medium
CN110443910B (en) Method, system, device and storage medium for monitoring state of unmanned device
CN112162906A (en) Server behavior monitoring method of probe management platform architecture

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
CP01 Change in the name or title of a patent holder
CP01 Change in the name or title of a patent holder

Address after: Room 508-598, Xitian Gezhuang Town Government Office Building, No. 8 Xitong Road, Miyun County Economic Development Zone, Beijing 101500

Patentee after: Beijing Rubo Technology Co., Ltd.

Address before: Room 508-598, Xitian Gezhuang Town Government Office Building, No. 8 Xitong Road, Miyun County Economic Development Zone, Beijing 101500

Patentee before: BEIJING INTELLIGENT HOUSEKEEPER TECHNOLOGY CO., LTD.

TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20210819

Address after: 301-112, floor 3, building 2, No. 18, YANGFANGDIAN Road, Haidian District, Beijing 100038

Patentee after: Beijing Rubu Technology Co.,Ltd.

Address before: Room 508-598, Xitian Gezhuang Town Government Office Building, No. 8 Xitong Road, Miyun County Economic Development Zone, Beijing 101500

Patentee before: BEIJING ROOBO TECHNOLOGY Co.,Ltd.