opcodesio / log-viewer

Fast and beautiful Log Viewer for Laravel
https://log-viewer.opcodes.io
MIT License
3.49k stars 250 forks source link

RuntimeException: A facade root has not been set. (related to log facade) #339

Closed stephenstack closed 7 months ago

stephenstack commented 7 months ago

Hi,

Odd issue. If i try to update or remove log-viewer using composer, i get the following on an autoload. Which means I'm kind of stuck. I've tried to trace the source of this, but I am getting stuck. The only thing I can find is when I dump what is being resolved in the container, the name comiing back is 'log'. What kind of conflict is going on here?

❯ composer remove opcodesio/log-viewer ./composer.json has been updated Running composer update opcodesio/log-viewer Loading composer repositories with package information Updating dependencies Lock file operations: 0 installs, 0 updates, 1 removal

stephenstack commented 7 months ago

Update: i found I had to remove the log-viewer.php form the configs directory. To get back and working.

arukompas commented 7 months ago

In errors like this, the problem is something with the configuration files, yes. E.g. a config file uses a class that's not defined any more (after uninstalling a package) or has some sort of error when executing.

In this case, Log Viewer v2 was using Opcodes\LogViewer\Level::caseValues() inside the config, a class which was no longer available and thus threw an exception.

This was removed in later versions and is no longer the case. When upgrading to a newer Log Viewer version, make sure to also update the config file 😄

Closing this as the issue is related to an older version. I can't change/fix it on v2 because that would be a breaking change unfortunately. Log Viewer v3 does not have this issue.