Abstract:At present, the distributed business application logs are stored in the local log files on distributed servers, and there is no centralized storage and management, which leads to slow positioning speed for business system problems, and low efficiency in solving problems. This paper provides a distributed log collection and analysis scheme based on OSGi technology. It uses a centralized log storage server to store the log, and provides a set of general log model, so that distributed business application nodes can send the log data to the servers, based on the model. The log storage server receives log data of each node and then unifies storage and interface of analysis display, helping developers to quickly locate and analyze the problem. The scheme is deployed to the application system in the form of the OSGi plug-in, and log is stored in the original way after unloading the OSGi plug-in. Application results show that when the log management scheme is applied to 1000 concurrent business applications which perform logging, the access performance is improved to 2 seconds, and there is no log data loss. According to the developers' feedback, the error logs are clearer, the time of locating problems is obviously shorter than ordinary log storage.