Before discussing log file lets discuss what is "Video Recorder". It is just a series of snapshot or photos taken at various successive small interval, Right? So, what is use of this video that have been recorded by the video recorder? The greatest use is that we can always track that what had happened at that particular interval of time. Tracking of past or history is always a valuable information. As we always learn from the past and apply to present.
Just like video camera recorder that records sequence of photos to whatever it is focused. OR black box of an airplane that records everything going on with the plane in the event of a problem. Log files stores the records of detail information (like time and date at which event occurred, user name who was responsible for particular event etc.) about each events.
So, when we talk about log file related to the "Computer Science" it is any file that stores the detailed information (in a particular format or syntax) about the events that has occurred in devices (like web servers, database sever, personal computers, laptops and various other digital device that support logging or create log files) or the application on these devices. Events could be user actions, such as clicking a mouse button or pressing a key, or system occurrences, such as running out of memory.