The invention relates to the technical field of
WEB development, in particular to an efficient log operating method. The JDK, with the version number being 1.5 or larger, of
JAVA is used in the method, and a universal
annotation interface of logs is achieved through an
annotation interface of the JDK. When Action codes of the Struts2 are compiled, a log
annotation interface is labeled before the logs needing to be inserted. Secondarily, configuration of a Struts2 interceptor is completed, and all user requests are configured to pass the interceptor. The
basic class of the Struts2 is compiled, and Action of other services needs to inherit the
basic class. When a user requests a struts2 method, the interceptor judges whether annotation interfaces exist or not through a method, and whether the logs need to be written into the services or not is judged. In the
code development process, if log
information needs to be written into the services, it is only needed that the log annotation interface is used before the service method is used. Due to the method, the log newly-increased functions of a
system can be greatly reduced, and development efficiency and upgrading efficiency are improved; the method can be used for log recording operation.