How to use .log files
.log files are created by operating systems and servers. They help with analysis and troubleshooting as well as improving the system. Since most .log files are created using text files, they can be opened with standard text editors.
What is a .log file?
Every time you use a computer, server or router different commands and processes are carried out. In a perfect world, this happens without issues and the system works seamlessly. If, however, there are errors or certain processes could be optimised, it’s necessary to have a way to check and analyse them. It’s for this reason that most standard systems create .log files. They are a kind of diary or log for the system, meaning all processes can be stored and looked at again in the future. A .log file is usually a document containing events that happen in the system in easy-to-understand text.
This means that users can also subsequently check how an error actually occurred or find out whether unwanted actions are being carried out within a system. Some .log files will also allow deleted or lost data to be restored. When doing this, it is important to note that .log files often have a pre-defined maximum size. If this is reached, newer entries will automatically replace older ones.
How is a .log file built?
Normally, .log files are completely line based, with a new line being created for every event. Depending on the type of the .log file, newer lines are added either at the top or bottom of the document and the order is always chronological. To improve orientation, the individual lines contain a timestamp giving you exact information on the date and time of an action.
What information is contained in a .log file?
Alongside the time, every entry in a .log file contains further important information. Depending on the type of .log file, these can include the source of the action (e.g., in the form of an IP address) or the urgency of the report in the case of critical entries or entries that serve as warnings. Other information that may be contained within an entry include usernames, file names, data being opened, the answer from corresponding systems, and the scope of the amount of data.
What format does a .log file use?
Most .log files use line coding such as ASCII and are created in text format. Among others, these can include Microsoft IIS3.0, NCSA, O’Reilly or W3SVC. On top of this, there are special formats such as ELF (Extended Log Format) or CLF (Common Log Format). The information contained in .log files can then, after a bit of training, be read and analyed quickly.
How do you open a .log file?
Since most .log files are standard text files, they can be opened and read using common text editors. These include:
- Apple Console
- Apple Text Edit
- Bean
- Cream
- jEdit
- Microsoft Notepad
- Microsoft Word
- OpenOffice Writer
- Smultron
Checking .log files regularly
While the .log files are designed to be user friendly, the system also logs a lot of personal data. For this reason, it is worthwhile to check .log files regularly to ensure that the system is actually deleting old entries. This not only saves memory but is also useful from a security point of view. You should also regularly create backups and after having done so, clean your hard drive.