'Laravel Telescope doesn't update log name after log name changes
- Telescope Version: 4.7.1
- Laravel Version: 8.82.0
- PHP Version: 7.4
- Database Driver & Version: SQL
Description:
I've got a custom log channel called Applications in my website, I was previously logging as "Application submitted" but decided to change the title of the log. Upon deploying the change, Telescope appears to be continuing to read from the previous log name despite clearing out Telescope's data.
I'm not getting any errors to log, and I do have data set in my variables.
What am I missing to get the new log names to show up in the Telescope dashboard, for example:
affiliate_full:foo,first_name:John - Application submitted
My method:
/**
* Store a newly created resource in storage.
*
* @param \Illuminate\Http\Request $request
* @return \Illuminate\Http\Response
*/
public function store(Request $request)
{
try {
$provider = new LES($request);
$res = Http::timeout(120)->post(
$provider->getSubmitEndpoint(),
$provider->getMappedApplicationToSubmit()
);
} catch (\Exception $e) {
return response()->json([
'message' => "Mapping failed"
], 422);
}
try {
$affiliate_full = $request->input('meta.affiliate_full') ?? 'unknown';
$first_name = $request->input('applicant.first_name') ?? 'unknown';
Log::channel('applications')->info("affiliate_full:$affiliate_full,first_name:$first_name - Application submitted", [
'provider' => 'LES',
'submitted_endpoint' => $provider->getSubmitEndpoint(),
'submitted_application_raw' => $request->all(),
'submitted_application_mapped' => $provider->getMappedApplicationToSubmit(),
'submitted_at' => Carbon::now(),
'raw_res_json' => $res->json(),
'raw_res_status' => $res->status()
]);
} catch (\Exception $e) { }
return response()->json($res->json(), $res->status());
}
My channel:
'channels' => [
'applications' => [
'driver' => 'daily',
'path' => storage_path('logs/applications/applications.log'),
'level' => 'info',
'days' => 7
],
],
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
