opcodesio / log-viewer

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

Remote Host configured but logs are not loaded nor shown #398

Open kantmn opened 3 weeks ago

kantmn commented 3 weeks ago

Hi i have setup your log-viewer package inside my development environment.

two projects have the package installed and if i have understood it correctly Project A (mainly the log-viewer) can access a remote host Project B (https://log-viewer.opcodes.io/docs/3.x/configuration/multiple-hosts)

config in Project A 'hosts' => [ 'local' => [ 'name' => ucfirst(env('APP_ENV', 'local')), ], 'toolero.ddev.site' => [ 'name' => 'projectA.ddev.site', 'host' => 'http://projectA.ddev.site/log-viewer', ], ],

config in Project B the remote host ` 'enabled' => env('LOG_VIEWER_ENABLED', true),

'api_only' => env('LOG_VIEWER_API_ONLY', true),

'require_auth_in_production' => false,

......

'hosts' => [
    'local' => [
        'name' => ucfirst(env('APP_ENV', 'local')),
    ],

], ` no other var was changed i have cleared the application cache

i can call the log-viewer url/api in my browser correctly when the api_only is set to false if api_only is set to true the same url result in 404 not found, i would have expected an denied ?

also i can call the api via curl in console run curl projectb.ddev.site/log-viewer/api/folders etc it responds

when opening in project A inside my browser and switching via dropdown to the project b host, it looks it is loading something, but the ui remains the same, folders are unchanged and no files from project b are visible.

therefore i have checked the browser network analysis tab after switch to host B, i can see there is a json response with an object which download_url seems to be the project b, but it responds with the local (project a) files.

i have configured project b with http: as it seems to have trouble with self signed testing cert, but in the download url it is using https:

am i doing something wrong here? i do not see any error inside the laravel.log

any help is appreciated, and thanks for the good work

PS: for anyone also having issues using the custom log types, the docs seems not to be complete, take a look at the laravelLogLevel class and copy what is needed

bhagat-abhishek commented 1 week ago

@kantmn maybe you should re-look the config. My suggessition are try with a fresh laravel install first. Hope you find some help.

kantmn commented 1 week ago

@bhagat-abhishek well this is a fresh install already, and as far is see i followed the config guide. that is why opened this support thread, to receive help.

i made it simpled, disable the authentication and only added the remote host to the config and added the package to the target host.

if you see the error please tell me

bhagat-abhishek commented 1 week ago

Ohh, well let me also try I will let you know if I find any error.

Regards Abishek Bhagat

On Mon, Oct 21, 2024 at 10:03 PM Kantmn @.***> wrote:

@bhagat-abhishek https://github.com/bhagat-abhishek well this is a fresh install already, and as far is see i followed the config guide. that is why opened this support thread, to receive help.

i made it simpled, disable the authentication and only added the remote host to the config and added the package to the target host.

if you see the error please tell me

— Reply to this email directly, view it on GitHub https://github.com/opcodesio/log-viewer/issues/398#issuecomment-2427167066, or unsubscribe https://github.com/notifications/unsubscribe-auth/AUMBOKW5D2PE2JOXCWBBPGLZ4UUEPAVCNFSM6AAAAABPXDDTRWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDIMRXGE3DOMBWGY . You are receiving this because you were mentioned.Message ID: @.***>

arukompas commented 1 week ago

Project A config has a host that points to ProjectA as well. Shouldn't it point to Project B instead?

bhagat-abhishek commented 1 week ago

Seems like she’s

Regards Abishek Bhagat

On Tue, Oct 22, 2024 at 12:20 AM Arunas Skirius @.***> wrote:

Project A config has a host that points to ProjectA as well. Shouldn't it point to Project B instead?

— Reply to this email directly, view it on GitHub https://github.com/opcodesio/log-viewer/issues/398#issuecomment-2427472928, or unsubscribe https://github.com/notifications/unsubscribe-auth/AUMBOKUFGL3SNXDOGPH5JB3Z4VEIZAVCNFSM6AAAAABPXDDTRWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDIMRXGQ3TEOJSHA . You are receiving this because you were mentioned.Message ID: @.***>

kantmn commented 5 days ago

sorry for the delay. i had no time to investigate this, but i promise to post back once i do.