摘要 |
The invention discloses a monitoring method and a device for an application program. The method comprises the following steps of: adding a monitoring hook in a class file, wherein the monitoring hook is associated with a monitoring program; and invoking the monitoring program associated with the monitoring hook to monitor the application program when carrying out the monitoring hook of the class file, wherein codes of the monitoring program and the application program are in different class files, and the class files are independent from the class file containing the monitoring hook. According to the invention, problems of code complexity and higher maintenance cost in the prior art are solved by separating a service logic code from the monitoring program, and the maintenance cost and the complexity of the codes are lowered. |