rap2hpoutre / laravel-log-viewer

:dromedary_camel: Laravel log viewer
MIT License
3.14k stars 374 forks source link

getting the log file from another app folder #123

Closed galdazbiz closed 6 years ago

galdazbiz commented 6 years ago

I want to put this install in another parent folder called admin.mydomain.com, but access the laravel folder called mydomain.com, is there any easy way to do it?

rap2hpoutre commented 6 years ago

I'm not sure I understand. I use https://admin.myproject.localhost in one of my project and "it works" (I mean I'm still on the same subdomain, no redirection: I can access to https://admin.myprojects.localhost/logs).

Anyway, you are free to declare routes to the log viewer as you want. You can even create multiple route to the log viewer and handle domain prefix or wathever. Just add new routes to the controler.

Route::get('logs', '\Rap2hpoutre\LaravelLogViewer\LogViewerController@index');
//...
Route::get(
    'alternate-route-to-logs', 
    '\Rap2hpoutre\LaravelLogViewer\LogViewerController@index'
);
// And you can even route subdomains.

Still I'm not sure I understood your request, feel free to post a new comment if I'm wrong!

galdazbiz commented 6 years ago

Thank you so much for your quick answer!!!

I think you got my idea, I have a parent folder called myprojects with all my webs, one of them is the folder oneFolder where I have the laravel app. Another folder is adminFolder which has it's own laravel independent app where I can admin my webs. So once I install your app in adminFolder the questions are:

1) Is it possible to read the logs files from myprojects/oneFolder instead of the logs from myprojects/adminFolder. Doing something like /../oneFolder/logs/laravel.log or /myprojects/oneFolder/logs/laravel.log that it's the correct source log 2) Or imagine I want to manage several logs files from several domains, is it mandatory to install the vendor on each domain, or can I do something like admiFolder.com/logsForOneFolder, admiFolder.com/logsForSecondFolder

So I think in my previous post I wasn't very clear ;) because additionally in my nginx config, I have separated routes for each subdomain, I'm not using the laravel subdomain routes to not mess the admin side (several apps) with the production side.

galdazbiz commented 6 years ago

well @rap2hpoutre , still not lucky, if you have any tip it will be welcome haha, sorry to ask but when I try by myself and I'm stuck..

cino commented 6 years ago

@galdazbiz From reading this issue I'd say this feature is not the purpose of a package like this. I'd suggest installing it in all the different Laravel applications. In that way it would also be separated for each of your applications.

rap2hpoutre commented 6 years ago

I think @cino is right. I close this issue, feel free to comment if you think we are wrong!