E-commerce is an important system in the network and digital age. However, the network intrusion, malicious users, virus attack and system security vulnerabilities have continued to threaten the operation of the e-commerce, making e-commerce security encounter serious test. How to improve e-commerce security has become a topic worthy of further exploration. Combining data logging, event monitoring and cloud computing three technologies, this paper proposes a Cloud-based Security Event Detection Mechanism (CSEDM). Applying the CSEDM, security event detection procedure can timely detect security event, and assist follow repair. CSEDM can enhance e-commerce security effectively and reduce e-commerce security risk.