Apache is one of the popular Web server software.It is an important part of the Internet infrastructure.So its network security is particularly important.Apache logs record all requests to the server.By analyzing Apache logs,the study discovers security threats and potential security threats in a timely manner,so as to ensure network and server security.Then study selects Apache log files,uses isolated forest algorithm for log analysis and anomaly detection,and visually displays the results in combination with visualization function library of Python.Log type analysis shows that illegal logs account for 7.93%.According to the monthly traffic trend analysis,the number of visits in November is 2121,which is extremely prominent.Through statistics of IP visits,it is found that the number of visits ranked first is 1002 times,which is nearly twice the number of visits ranked second(624 times).Abnormal log frequency detection finds that abnormal behaviors exist at 3 am in the log,and the abnormal logs account for a relatively small proportion.However,visual analysis can be used to monitor the months with abnormal access and disable abnormal IP addresses to prevent malicious attacks.