Laravel logs in Heroku not showing up - laravel

I've deployed a Laravel app to heroku by following the official guide. It says to change APP_LOG=errorlog, which I've done.
I've also tried two different versions of this, the commented line being the variation.
$this->app->configureMonologUsing(function($monolog){
// $monolog->pushHandler(new \Monolog\Handler\SyslogHandler('papertrail'));
$monolog->pushHandler(new \Monolog\Handler\StreamHandler('php://stderr', \Monolog\Logger::WARNING));
});
If I use Log::error('something') I'm not seeing anything. I'm looking in both papertrail, and the CLI command heroku logs --tail --app {appname}

You must set LOG_CHANNEL=errorlog as a Heroku environment variable.
This setting is for Laravel 5.6, in older versions it was other. (and that "old" information is found on most internet sites, when searching for the problem)
This information can be found in .env file, which values must be manually set in Heroku.
Why?
The .env is not transferred to heroku, because it is listed in .gitignore.
BTW: I had the same issue today, seems like the setting you tried was valid for an older version of Laravel. I now use 5.6.

Related

Local url [app_url] not working in Laravel Breeze Vue

So I tried creating a new project using Breeze+vue in Laravel.
I was following this guide: https://www.youtube.com/watch?v=A7UlfXPhsaA
When I finally got vite running on npm run dev without issues, I came across the app_url and I tried to change it to something similar like in that guide (timestamp 6:14 in video), in my case the app_url value was just http://localhost and I changed it to http://grandia.test.
And it reflects like that when vite is running:
VITE v3.1.0 ready in 1031 ms
➜ Local: http://localhost:5173/
➜ Network: use --host to expose
LARAVEL v9.28.0 plugin v0.6.0
➜ APP_URL: http://grandia.test
but nothing happens when I go to the site. only the localhost:5173 works properly.
I tried googling for answers but I couldn't find anything helpful.
Could someone help me out what I'm doing wrong or missing? Thanks!
I had the same issue, It look like you changed URL: http://grandia.test instead of localhost. So you should try with npm run build instead.
Changing Laravel’s APP_URL parameter will not magically allow you to choose the URL your website is served at. It will only tell Laravel what it should use when generating URLs related to your website.
The video’s author uses the Laravel Valet local development environment. It provides a park command that allows you to automatically serve the subfolders of some folder (e.g. Sites in the video) at http://<subfolder>.test.
In the video, the project is created in Sites/reddit-clone/, which makes it possible to directly access it at reddit-clone.test.

View laravel in heroku doesn't run correctly when first time deploy to heroku

im new to laravel. so i just try to deploy app to heroku but seem it dont work correctly
but when i run local at 127.0.0.1:8000 it work fine
i already put Procfile, add Config Vars to heroku but still not work.
i don't know to fix this, please help me. thanks.
full code here if you need
https://github.com/salmanagustian/wedding-digital-invitation

Heroku not applying environment variable changes in Okta OAuth 2.0 PKCE VueJs app

I' trying to execute the OAuth 2.0 PKCE demo with a VueJs app outlined here:
https://developer.okta.com/blog/2019/08/22/okta-authjs-pkce
https://github.com/oktadeveloper/okta-auth-js-pkce-example
Once in the Heroku App I have these Environment Variables:
Everything appears to be running fine except for the fact that the variables OKTA_CLIENT_ORGURL and OKTA_OAUTH2_ISSUER were refering to an incorrect dev-XXXXXX address, the correct one is the one shown on the picture (dev-371167), before it was someone else's url (dev-739491) for some reason.
The problem is that after making the changes shown in the image to the correct dev url, it's still making the calls to the old dev-739491 url.
Heroku doesn't seem to be refreshing or making the desired changes in the app.
Am I missing an option to refresh? Is it possible to rebuild so it reads the new changes? Could the problem be in the code/build itself?
Thanks.
EDIT: As per the suggestion in the comment I turned the app off then on again and it still didn't make the changes.
This is what my screen looks like:
EDIT 2: I have since deployed the same app two more times and reading the build logs it assigns a random CLIENT_ID and URls. Each deployed app has a different pair of these. I don't know where they come from.
I wrote the Okta Heroku Add-On. I'm looking into the behavior you're seeing.
When you change the environment variables, heroku should restart your app automatically.
So, the two issues are that the environment variables didn't match you saw in Heroku didn't match with what you expected them to be and that the app doesn't seem to be picking up on the environment variables.
How did you know that dev-371167 was the correct org and that dev-739491 was incorrect?
When you say you deployed the app two more times, what exactly are you doing to deploy? Are you using the Heroku cli?

Heroku No such app for Dropbox based app

I had a app hosted on 'inputbox.herokuapp.com'.
My app was giving error even after successful deployment. So, I deleted the app and recreated the same app.
But now I am getting error message as:
"Heroku | No such app
There is no app configured at that hostname.
Perhaps the app owner has renamed it, or you mistyped the URL."
I looked around for heroku docs but nothing works.
I dont know how to get this fixed. Please help.
Check what apps you currenty have using
heroku apps
It should say something like
=== My Apps
inputbox
If it doesn't, then you know what the problem is. Let's say it has one of those silly generated names, then you can rename it using the following command:
heroku apps:rename inputbox
Happy hacking!

failing to enable user-env-compile on Heroku

it is the first time I ask for something so sorry if I'm not enough precise!
I tried to upload my rails app on heroku using enabling the user-env-compile to manage my secret keys but I have an error "No such feature: user-env-compile".
I checked on Heroku devcenter and seems that user-env-compile has been deprecated and replaced by the ENV_DIR argument.
Here the link:
https://devcenter.heroku.com/articles/labs-user-env-compile
I cant really get what to do! can someone explain better to me what I'm supposed to do?
thank you,
Federico
You don't have to do anything (the labs is deprecated and you should delete it), by default now heroku is exporting your environement variables during slug compilation.
Be careful, it is not recommended to use the environement variable during slug compilation (you can check http://12factor.net/ for more informations)
Hope it helps.

Resources