opcodesio / log-viewer

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

http://localhost/?file=e0549170-laravel.log #171

Closed m-derakhshi closed 1 year ago

m-derakhshi commented 1 year ago

hi route log viewer is : http://localhost/log-viewer/

but after click any link file,error,..... changed to 'http://localhost/?file=e0549170-laravel.log'

arukompas commented 1 year ago

Hi @mderakhshi , it sounds like a problem with the server setup.

First, what is the result of running php artisan route:list command?

And second, do your other routes work well?

m-derakhshi commented 1 year ago

result of : php artisan route:list for log viewer :

GET|HEAD log ...................................................................................................................................................................................................... Modules\Log\Http\Controllers\LogController@index GET|HEAD log-viewer ................................................................................................................................................................................................ blv.index › Opcodes\LogViewer › IndexController GET|HEAD log-viewer/file/{fileIdentifier}/download .................................................................................................................................................. blv.download-file › Opcodes\LogViewer › DownloadFileController GET|HEAD log-viewer/folder/{folderIdentifier}/download .......................................................................................................................................... blv.download-folder › Opcodes\LogViewer › DownloadFolderController GET|HEAD log-viewer/is-scan-required ........................................................................................................................................................... blv.is-scan-required › Opcodes\LogViewer › IsScanRequiredController GET|HEAD log-viewer/scan-files ............................................................................................................................................................................ blv.scan-files › Opcodes\LogViewer › ScanFilesController GET|HEAD log-viewer/search-progress ................................................................................................................................................................. blv.search-more › Opcodes\LogViewer › SearchProgressController

all link worked in page by ajax, but browser url change without /log-viewer/ like: http://localhost/?file=e0549170-laravel.log

m-derakhshi commented 1 year ago

this package is amazing and beauty, i have multi monitor to work when i come to window log viewer and click ctrl+r, receive main route of laravel because router doesn't have log-viewer in path and removed before by click on file link : http://localhost/?file=e0549170-laravel.log

arukompas commented 1 year ago

@mderakhshi how are you running the Laravel project on your machine? Are you using Valet, Xampp, Laragon, Docker, Sail or something else?

Do you have the virtual host config for this app that you could share? It seems to me like the server does not read the path of the URL properly and thus the Laravel app always thinks it's on the root path.

m-derakhshi commented 1 year ago

i use nginx vs docker with default config log-viewer(not publish) laravel env APP_URL=http://localhost log-viewer full worked self-page at "http://localhost/log-viewer",
but change browser url without log-viewer same: http://localhost/?file=e0549170-laravel.log It seems it can't detect the config on the front end

m-derakhshi commented 1 year ago

for installation, only runed: composer require opcodesio/log-viewer and worked.

in front code, config detected, because in direct url "view-source:http://localhost/log-viewer", /log-viewer/ exist :

@scan-files.window="$store.fileViewer.initScanCheck('http://localhost/log-viewer/is-scan-required', 'http://localhost/log-viewer/scan-files')"  

but buttons and links haven't '/log-viewer/' in path

arukompas commented 1 year ago

Hey all, I've just released v2 of the Log Viewer without the Livewire dependency. It should now work a lot better and in more environments.

Read more about the v2 release and how to upgrade here - https://arunas.dev/log-viewer-v2/

Closing this for now. If you still have issues with v2, please open a new issue. Thanks! 😀