Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change Log contract to LoggerInterface. #1624

Merged
merged 1 commit into from
Feb 16, 2018
Merged

Change Log contract to LoggerInterface. #1624

merged 1 commit into from
Feb 16, 2018

Conversation

LEI
Copy link

@LEI LEI commented Feb 13, 2018

After updating to Laravel 5.6, this message is displayed on error (e.g. wrong column name):

Class Illuminate\Contracts\Logging\Log does not exist

As described in the upgrade guide, Illuminate\Contracts\Logging\Log should be changed to Psr\Log\LoggerInterface.

Illuminate\Contracts\Logging\Log was removed in Laravel 5.6

Psr\Log\LoggerInterface should be used instead as described in:
https://laravel.com/docs/5.6/upgrade#Logging
@yajra
Copy link
Owner

yajra commented Feb 15, 2018

Is this backward compatible with lower version of Laravel? We may have to do a major bump if not. Haven't updated to 5.6 yet and I can't verify this yet. Thanks!

@yajra
Copy link
Owner

yajra commented Feb 15, 2018

Maybe we should just use the facade and remove the interface. Or resolve it using IoC app('log') key?

@yajra yajra changed the title Class Illuminate\Contracts\Logging\Log does not exist Change Log contract to LoggerInterface. Feb 15, 2018
@LEI
Copy link
Author

LEI commented Feb 15, 2018

Not tested, but the upgrade note seems to indicate there is no side effects:

This interface has been removed since this interface was a total duplication of the Psr\Log\LoggerInterface

The Psr namespace should be available before 5.6 as well, I'll try to find since when exactly.

@LEI
Copy link
Author

LEI commented Feb 16, 2018

The interface signature hasn't been modified since its introduction on 5.0, except for a PSR-2 style change. Though both useFiles and useDailyFiles methods are missing from the PSR-3 interface introduced in 5.6.

I can't find a note about it in the documentation. I tend to think it should be backward compatible with the DataTables usage of the logger.

@yajra
Copy link
Owner

yajra commented Feb 16, 2018

Confirmed still working on 5.5, thanks!

@yajra yajra merged commit 307fb53 into yajra:8.0 Feb 16, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants