.log

What is a .log file?

Log File · Data · Various · n/a

A LOG file is a plain-text diary a program keeps of what it did, usually one timestamped line per event or error. You open it in any text editor, and it is mainly there to help diagnose problems.

Category
Data
MIME type
Type
Plain text
Is a .log file safe to open? Safe to open: a log is plain text and cannot run. Just be mindful that it may hold sensitive paths or addresses before you share it.

What is a .log file used for?

Software writes log files as it runs, appending a line whenever something notable happens: an action, a warning, an error, a startup or shutdown. It is a running history you can read after the fact.

They are the first thing to check when something breaks. Installers, servers, games and operating systems all keep logs, and the useful lines are usually the ones marked ERROR or WARN near the time the problem occurred.

Logs are plain text, so they cannot run and are safe to open or delete. They can grow large, and old ones are generally fine to remove once you no longer need to troubleshoot.

One caution: logs can contain sensitive details such as file paths, usernames or IP addresses, so glance through before sharing one for support.

How to open a .log file

The .log format opens in the following apps, grouped by operating system. If one app does not work, try another from the same list.

Windows

  • Notepad
  • Notepad++
  • VS Code

macOS

  • TextEdit
  • Console app
  • VS Code

Linux

  • Any text editor
  • less / tail -f

Web

  • Any online text viewer

How to convert a .log file

You can convert a .log file to Already plain text using a conversion tool or the export menu of an app that opens it.

.log file signature (magic bytes)

Programs recognise a .log file by the bytes at the start of the file, not by its name. These are the signatures for LOG.

Hex signatureOffsetNote
(no fixed signature)0plain text; no fixed signature, though many logs begin each line with a timestamp

See the full magic-numbers reference for every format.

Frequently asked questions

What is a .log file?

A LOG file is a plain-text diary a program keeps of what it did, usually one timestamped line per event or error. You open it in any text editor, and it is mainly there to help diagnose problems.

How do I open a LOG file?

Open it in any text editor, such as Notepad on Windows, TextEdit on Mac, or VS Code. To watch a log update live on Linux or Mac, use tail -f in the terminal.

Can I delete .log files?

Usually yes. Once you no longer need them for troubleshooting, log files are safe to remove. Some are locked while the program that writes them is running.

Related formats

Sources

Details on this page were checked against authoritative references: