Commit 5114f2ee authored by Taylor Otwell's avatar Taylor Otwell

Trimming comment bloat in Log class.

parent 5643daa6
......@@ -44,20 +44,13 @@ class Log {
*/
public static function write($type, $message)
{
// -----------------------------------------------------
// Create the yearly and monthly directories if needed.
// -----------------------------------------------------
static::make_directory($directory = APP_PATH.'storage/logs/'.date('Y'));
static::make_directory($directory .= '/'.date('m'));
// -----------------------------------------------------
// Each day has its own log file.
// -----------------------------------------------------
// Get the daily log file filename.
$file = $directory.'/'.date('d').EXT;
// -----------------------------------------------------
// Append to the log file and set the permissions.
// -----------------------------------------------------
file_put_contents($file, date('Y-m-d H:i:s').' '.$type.' - '.$message.PHP_EOL, LOCK_EX | FILE_APPEND);
chmod($file, 0666);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment