Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the difference between .log and .txt?

Tags:

file

php

logging

Is there any functional difference between

file_put_contents( '/Users/jake/Development/testing.log', ob_get_clean(), FILE_APPEND );

and

file_put_contents( '/Users/jake/Development/testing.txt', ob_get_clean(), FILE_APPEND );

?

I can open both files in sublime text 2, and I'm not sure what the difference between the extensions is.

like image 759
jake_feyereisen Avatar asked Jul 29 '13 21:07

jake_feyereisen


People also ask

What does .log mean on a file?

Log files are a historical record of everything and anything that happens within a system, including events such as transactions, errors and intrusions.

What is the difference between data file and log file?

Data files contain data and objects such as tables, indexes, stored procedures, and views. Log files contain the information that is required to recover all transactions in the database.

Is .log a file type?

LOG is the file extension for an automatically produced file that contains a record of events from certain software and operating systems. While they can contain a number of things, log files are often used to show all events associated with the system or application that created them.


1 Answers

No there is no difference. You can use either. For convention and to show the purpose log files use .log extension.

and yes you can usually open them with any text editor.

like image 119
DarthVader Avatar answered Oct 26 '22 17:10

DarthVader