Skip to content

Error with date #7

@B0bbyD0llar

Description

@B0bbyD0llar

Hello,

i have tested your example and i get an error.

my code

$logFile = 'log/app.log';
$reader = new LogReader($logFile);

foreach ($reader as $log) {
    echo sprintf("The log entry was written at %s. \n", $log['date']->format('Y-m-d h:i:s'));
  }

My Logfile has 45 entries.

i get this error:
Call to a member function format() on null at line echo sprintf("The log entry was written at %s. \n", $log['date']->format('Y-m-d h:i:s'));

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions