The invention discloses a method and a system for obtaining server logs. The system comprises at least one log server and multiple working servers, wherein the working servers are used for sending generated server logs to the log server; and the log server is used for receiving the server logs from the working servers, storing the server logs locally, and when receiving a query request from a client, obtaining corresponding server logs locally and returning the obtained server logs to the client. According to the system, by collecting the server logs on the multiple working servers, intensively storing the collected server logs to one log server, and providing a query module for a user to view the server logs, the optimization on a procedure of querying the server logs is realized, and the efficiency of troubleshooting server program error is improved.