Trouble Logging from Laravel (Local) to Remote Elasticsearch on AWS – Any Tips?
Hey everyone!
I'm working on a Laravel project locally and for a test trying to send application logs to a **remote Elasticsearch cluster hosted on AWS**.
The idea is to centralize logs for auditability, and I'm using **Monolog** to push logs to a specific index.
# What I’ve done so far:
* Set up Laravel to use a custom Monolog handler with the `elasticsearch/elasticsearch` PHP client.
* Created a dedicated index (`custom-output-index-001`) on the remote host.
* Verified I can connect to the AWS host using cURL and basic auth.
* Confirmed the logs are being written *locally* if I point to a local Elasticsearch instance (`localhost:9200`).
# The problem:
When I switch the Elasticsearch host in the Laravel config to the remote endpoint (on AWS), **no logs show up in the remote index**, and I get **no exceptions or errors** in the Laravel logs.
# What I suspect:
* The client version (v9.x) may not be compatible with the remote ElasticSearch instance. I’m considering downgrading to the v7.x client which uses `application/json` instead of `application/x-ndjson`.
* Content-Type mismatch? The remote service may reject the format used by the newer client.
* Maybe a network/firewall/SIGv4 auth issue?
* Or the index mapping/settings on AWS Elasticsearch need to be adjusted to accept those documents?
# What I’d like to know:
* Has anyone successfully configured Laravel to log to a remote Elasticsearch endpoint?
* Did you have to downgrade the client library or tweak headers?
* Any best practices or gotchas when working with Elasticserach + Laravel?
This is myy current logging config
use Elastic\Elasticsearch\ClientBuilder;
use Elastic\Elasticsearch\Exception\AuthenticationException;
use Illuminate\Support\Facades\Log;
use Monolog\Logger;
use Monolog\Handler\ElasticsearchHandler;
use Monolog\Formatter\ElasticsearchFormatter;
class ElasticsearchLogger
{
/**
* @throws AuthenticationException
*/
public function __invoke(array $config): Logger
{
$client = ClientBuilder::create()
->setHosts([
[
'host' => MY_HOST,
'port' => ENV_PORT,
'scheme' => ENV_SCHEME,
'user' => '********', // ← Basic Auth username
'pass' => '*****', // ← Basic Auth password
]
])
->build();
$indexName = 'custom-output-index-001';
$handler = new ElasticsearchHandler($client, [
'index' => $indexName,
'type' => '_doc',
]);
$response = $client->info();
Log::debug("CLIENT",[$response]);
$formatter = new ElasticsearchFormatter($indexName, '_doc');
$handler->setFormatter($formatter);
return new Logger('elastic', [$handler]);
}
}
Thanks in advance!
https://redd.it/1lkwi22
@r_php
Hey everyone!
I'm working on a Laravel project locally and for a test trying to send application logs to a **remote Elasticsearch cluster hosted on AWS**.
The idea is to centralize logs for auditability, and I'm using **Monolog** to push logs to a specific index.
# What I’ve done so far:
* Set up Laravel to use a custom Monolog handler with the `elasticsearch/elasticsearch` PHP client.
* Created a dedicated index (`custom-output-index-001`) on the remote host.
* Verified I can connect to the AWS host using cURL and basic auth.
* Confirmed the logs are being written *locally* if I point to a local Elasticsearch instance (`localhost:9200`).
# The problem:
When I switch the Elasticsearch host in the Laravel config to the remote endpoint (on AWS), **no logs show up in the remote index**, and I get **no exceptions or errors** in the Laravel logs.
# What I suspect:
* The client version (v9.x) may not be compatible with the remote ElasticSearch instance. I’m considering downgrading to the v7.x client which uses `application/json` instead of `application/x-ndjson`.
* Content-Type mismatch? The remote service may reject the format used by the newer client.
* Maybe a network/firewall/SIGv4 auth issue?
* Or the index mapping/settings on AWS Elasticsearch need to be adjusted to accept those documents?
# What I’d like to know:
* Has anyone successfully configured Laravel to log to a remote Elasticsearch endpoint?
* Did you have to downgrade the client library or tweak headers?
* Any best practices or gotchas when working with Elasticserach + Laravel?
This is myy current logging config
use Elastic\Elasticsearch\ClientBuilder;
use Elastic\Elasticsearch\Exception\AuthenticationException;
use Illuminate\Support\Facades\Log;
use Monolog\Logger;
use Monolog\Handler\ElasticsearchHandler;
use Monolog\Formatter\ElasticsearchFormatter;
class ElasticsearchLogger
{
/**
* @throws AuthenticationException
*/
public function __invoke(array $config): Logger
{
$client = ClientBuilder::create()
->setHosts([
[
'host' => MY_HOST,
'port' => ENV_PORT,
'scheme' => ENV_SCHEME,
'user' => '********', // ← Basic Auth username
'pass' => '*****', // ← Basic Auth password
]
])
->build();
$indexName = 'custom-output-index-001';
$handler = new ElasticsearchHandler($client, [
'index' => $indexName,
'type' => '_doc',
]);
$response = $client->info();
Log::debug("CLIENT",[$response]);
$formatter = new ElasticsearchFormatter($indexName, '_doc');
$handler->setFormatter($formatter);
return new Logger('elastic', [$handler]);
}
}
Thanks in advance!
https://redd.it/1lkwi22
@r_php
Reddit
From the PHP community on Reddit
Explore this post and more from the PHP community
New to php, but curious about it with Laravel
Hi guys,
I've been lurking some time now, and I want to try out php with Laravel.
Which editor do you guys recommend for php development?
Also any extensions that are useful?
Cheers!
https://redd.it/1llb32w
@r_php
Hi guys,
I've been lurking some time now, and I want to try out php with Laravel.
Which editor do you guys recommend for php development?
Also any extensions that are useful?
Cheers!
https://redd.it/1llb32w
@r_php
Reddit
From the PHP community on Reddit
Explore this post and more from the PHP community
Commenter v3 is a game changer with nested reply support and much more!
https://github.com/Lakshan-Madushanka/commenter/releases/tag/3.0.0
https://redd.it/1llmszn
@r_php
https://github.com/Lakshan-Madushanka/commenter/releases/tag/3.0.0
https://redd.it/1llmszn
@r_php
GitHub
Release 3.0.0 · Lakshan-Madushanka/commenter
What's Changed [!Breaking Changes]
Feat: Add nested replies support. by @Lakshan-Madushanka in #130
format: renaming and changing folder structure by @Lakshan-Madushanka in #131
Format!: Chang...
Feat: Add nested replies support. by @Lakshan-Madushanka in #130
format: renaming and changing folder structure by @Lakshan-Madushanka in #131
Format!: Chang...
what are the quirks of php and what mindset should a php dev have ??
forgive if my words come out wrong and ill-informed
was told php is not an important language ,now have to work on it cuz I was a java dev. now i have to work in my hometown due to ma and pa so i have taken a php job
what makes a php dev great compared to say a java dev or c++ dev?? hidden quirks of the language and mindset
https://redd.it/1lloch0
@r_php
forgive if my words come out wrong and ill-informed
was told php is not an important language ,now have to work on it cuz I was a java dev. now i have to work in my hometown due to ma and pa so i have taken a php job
what makes a php dev great compared to say a java dev or c++ dev?? hidden quirks of the language and mindset
https://redd.it/1lloch0
@r_php
Reddit
From the PHP community on Reddit
Explore this post and more from the PHP community
Tempest 1.0 is now released: a new framework for PHP web and application development embracing modern PHP
https://tempestphp.com/blog/tempest-1
https://redd.it/1llpaoa
@r_php
https://tempestphp.com/blog/tempest-1
https://redd.it/1llpaoa
@r_php
Tempestphp
Tempest 1.0 — Tempest
Tempest's first stable release
Job search realities
Recently started job searching. Where I work is great, but there's no room for growth. After 2 months of applying all over the place, I haven’t landed a single interview.
The pickings are slim unless you’re a Senior with a god-tier toolkit or a Junior willing to sell your soul for pennies on the dollar. Is it AI? Is it cheap outsourcing? I don’t fucking know lol. All I know is, at this rate, I’m gonna be stuck in the same role for years 😭😭😭
Anyone else got it worse?
https://redd.it/1llr3fn
@r_php
Recently started job searching. Where I work is great, but there's no room for growth. After 2 months of applying all over the place, I haven’t landed a single interview.
The pickings are slim unless you’re a Senior with a god-tier toolkit or a Junior willing to sell your soul for pennies on the dollar. Is it AI? Is it cheap outsourcing? I don’t fucking know lol. All I know is, at this rate, I’m gonna be stuck in the same role for years 😭😭😭
Anyone else got it worse?
https://redd.it/1llr3fn
@r_php
Reddit
From the PHP community on Reddit
Explore this post and more from the PHP community
Looking for a php dev
Hello building a website based off of a template I have I would like a php dev that I can either pay for the project or pay per hour to change and make the template to my liking/needs. Feel free to message me your portfolio and rates please only message me if you speak perfect English I can’t deal with language barriers will be ignored if you ignore this thank you!
https://redd.it/1llyz6g
@r_php
Hello building a website based off of a template I have I would like a php dev that I can either pay for the project or pay per hour to change and make the template to my liking/needs. Feel free to message me your portfolio and rates please only message me if you speak perfect English I can’t deal with language barriers will be ignored if you ignore this thank you!
https://redd.it/1llyz6g
@r_php
Reddit
From the PHP community on Reddit
Explore this post and more from the PHP community
TIL Trump Mobile (Donald Trump's new carrier service) has a website that is built with Laravel, Livewire and Filament.
As I'm sure you've heard, Trump Mobile is a thing now and I decided to check out their website earlier.
Other than the amusing 500 errors when you try to reset an account email that doesn't exist, and the multitude of errors from YouTuber's that have tested out the platform with an account.
I found out that Trump Mobile clearly uses Filament by navigating to the admin url (https://www.trumpmobile.com/admin) and has livewire stuff happening on the main site as well.
This isn't meant to be political, I just found it amusing that the site clearly uses Laravel and how clunky and untested the website is.
https://redd.it/1lm0i0h
@r_php
As I'm sure you've heard, Trump Mobile is a thing now and I decided to check out their website earlier.
Other than the amusing 500 errors when you try to reset an account email that doesn't exist, and the multitude of errors from YouTuber's that have tested out the platform with an account.
I found out that Trump Mobile clearly uses Filament by navigating to the admin url (https://www.trumpmobile.com/admin) and has livewire stuff happening on the main site as well.
This isn't meant to be political, I just found it amusing that the site clearly uses Laravel and how clunky and untested the website is.
https://redd.it/1lm0i0h
@r_php
What's your favorite PHP feature?
For me I really love reflection. I recently had to use the reflection api to handle serializing custom pre <php7 class-based enums as well as new native php8 enums at the same time, the reflection api (and *BackedEnum* interface) made this a breeze. I can see how you could make some really powerful frameworks with how powerful reflection is and it only makes me wonder why it isn't a staple of every language.
https://redd.it/1lm0qhc
@r_php
For me I really love reflection. I recently had to use the reflection api to handle serializing custom pre <php7 class-based enums as well as new native php8 enums at the same time, the reflection api (and *BackedEnum* interface) made this a breeze. I can see how you could make some really powerful frameworks with how powerful reflection is and it only makes me wonder why it isn't a staple of every language.
https://redd.it/1lm0qhc
@r_php
www.php.net
PHP: BackedEnum - Manual
The BackedEnum interface
Casually achieving 600 req/s with a very simple PHP only WLP theme (PHP Swoole with Mostly Wordpress Compatible)
It seems PHP Swoole really takes PHP to the next level. This is even with some database calls. I can't post an image here, but for more info see r/WhitelabelPress
https://redd.it/1lm2v0a
@r_php
It seems PHP Swoole really takes PHP to the next level. This is even with some database calls. I can't post an image here, but for more info see r/WhitelabelPress
https://redd.it/1lm2v0a
@r_php
Reddit
From the PHP community on Reddit
Explore this post and more from the PHP community
How much do we really need many tools we use ?
Hello,
I'm PHP developer since 2009. I worked on websites and pure backend. Always with heavy traffic and volumetry of data to manage.
Here a list of framework/tools/library I used:
- Symfony framework with some component (Cache, Serializer, HttpClient, Messenger)
- API Plateform
- Doctrine ORM
- React Admin
All of them seems great but... Do I/we really need them ? Are we using them because we need them or because:
- they were here before us in our current job ?
- we don't know how to do without them ?
- some people in events said it was great so it should be true ?
- we didn't master the basics so we try to dodge our weakness ?
At my job, we removed Api Plateform. Because it is not so difficult and it does not take so much time to implement our endpoints with Symfony 7. Less configuration to maintains, less magic code executed, less bugs from space, less time lost.
We also replaced Doctrine ORM by Doctrine DBAL. We write directly our request in SQL. More convenient to read, debug, check performance issue (EXPLAIN, EXPLAIN ANALYSE with pgsql). Entities are hydrated manually. Yes it take a little time to write the code which hydrate ann entity from a PHP array, but less configuration, less magic bugs, less over generic code managing all possible cases we don't have. We directly know what exactly is happening, better performance.
Do you really feel something similar ?
https://redd.it/1lm4tai
@r_php
Hello,
I'm PHP developer since 2009. I worked on websites and pure backend. Always with heavy traffic and volumetry of data to manage.
Here a list of framework/tools/library I used:
- Symfony framework with some component (Cache, Serializer, HttpClient, Messenger)
- API Plateform
- Doctrine ORM
- React Admin
All of them seems great but... Do I/we really need them ? Are we using them because we need them or because:
- they were here before us in our current job ?
- we don't know how to do without them ?
- some people in events said it was great so it should be true ?
- we didn't master the basics so we try to dodge our weakness ?
At my job, we removed Api Plateform. Because it is not so difficult and it does not take so much time to implement our endpoints with Symfony 7. Less configuration to maintains, less magic code executed, less bugs from space, less time lost.
We also replaced Doctrine ORM by Doctrine DBAL. We write directly our request in SQL. More convenient to read, debug, check performance issue (EXPLAIN, EXPLAIN ANALYSE with pgsql). Entities are hydrated manually. Yes it take a little time to write the code which hydrate ann entity from a PHP array, but less configuration, less magic bugs, less over generic code managing all possible cases we don't have. We directly know what exactly is happening, better performance.
Do you really feel something similar ?
https://redd.it/1lm4tai
@r_php
Reddit
From the PHP community on Reddit
Explore this post and more from the PHP community
I wanted to share a project I've been working on
I created it to solve a common problem: processing large datasets (gigs of CSV, JSON, etc.) in a language like PHP without the noscript crashing due to memory exhaustion. The solution was to build the entire processing pipeline around PHP's Generators, which allows data to be handled one record at a time in a streaming fashion.
I was heavily inspired by the fluent and expressive syntax of libraries like .NET's LINQ and Laravel's Collections, so I focused on making the API as clean and readable as possible.
I any of you are interested here is the link to the repo:
https://github.com/zepzeper/torol
https://redd.it/1lmkdpl
@r_php
I created it to solve a common problem: processing large datasets (gigs of CSV, JSON, etc.) in a language like PHP without the noscript crashing due to memory exhaustion. The solution was to build the entire processing pipeline around PHP's Generators, which allows data to be handled one record at a time in a streaming fashion.
I was heavily inspired by the fluent and expressive syntax of libraries like .NET's LINQ and Laravel's Collections, so I focused on making the API as clean and readable as possible.
I any of you are interested here is the link to the repo:
https://github.com/zepzeper/torol
https://redd.it/1lmkdpl
@r_php
GitHub
GitHub - zepzeper/torol
Contribute to zepzeper/torol development by creating an account on GitHub.
I build a Flexible Business Application System in Symfony
I just want to bring your attention to one of my work👇
PrestoFox is a Flexible Business Application System that has collection of components that is need for build an application of any complexity.
It has built its multi-tenant architecture. Using PrestoFox one can build any kind of app like PWA, Web App, iOS app, Android app, desktop app, or browser plugin using a single code base.
It has components like custom fields, workflows, authentication, multi-tenancy, configuration system, reports, dashboard, permission system , import and export , attachment, data audit logs, pick list management, data grids and filters, search, GraphQL API, security, API call rate limiting , notifications, queue System, job scheduling, background job logging, data fixtures, data populators, translations, component health check end points, data validations etc.
This components work together in PrestoFox to make the strong foundation for the application that gets built on top of it. All these components make use of MIT Licensed Open Source solutions like Symfony , Vue JS , PostgreSQL etc
I have already built 5+ SaaS Products and 3+ internal business applications using it.
I am happy to answer any questions.
https://redd.it/1lmnf58
@r_php
I just want to bring your attention to one of my work👇
PrestoFox is a Flexible Business Application System that has collection of components that is need for build an application of any complexity.
It has built its multi-tenant architecture. Using PrestoFox one can build any kind of app like PWA, Web App, iOS app, Android app, desktop app, or browser plugin using a single code base.
It has components like custom fields, workflows, authentication, multi-tenancy, configuration system, reports, dashboard, permission system , import and export , attachment, data audit logs, pick list management, data grids and filters, search, GraphQL API, security, API call rate limiting , notifications, queue System, job scheduling, background job logging, data fixtures, data populators, translations, component health check end points, data validations etc.
This components work together in PrestoFox to make the strong foundation for the application that gets built on top of it. All these components make use of MIT Licensed Open Source solutions like Symfony , Vue JS , PostgreSQL etc
I have already built 5+ SaaS Products and 3+ internal business applications using it.
I am happy to answer any questions.
https://redd.it/1lmnf58
@r_php
Reddit
From the symfony community on Reddit
Explore this post and more from the symfony community
What should I expect in a 2-hour Symfony Backend Engineer technical interview?
Hey folks,
I have a 2-hour technical interview coming up with a CTO for a Symfony Backend Engineer position. It's a senior-level role, and I’d love to hear from anyone who's had similar long-format interviews.
What should I expect during these 2 hours?
Do they usually focus on deep architectural questions?
Is live coding involved?
How much of it is about Symfony core (like services, events, voters, Messenger)?
Do they dive into Doctrine internals or real project debugging?
Also:
How can I best prepare to make the most of the time?
Any questions I should ask them at the end?
Appreciate any tips, experiences, or resources 🙌
https://redd.it/1lmxgmr
@r_php
Hey folks,
I have a 2-hour technical interview coming up with a CTO for a Symfony Backend Engineer position. It's a senior-level role, and I’d love to hear from anyone who's had similar long-format interviews.
What should I expect during these 2 hours?
Do they usually focus on deep architectural questions?
Is live coding involved?
How much of it is about Symfony core (like services, events, voters, Messenger)?
Do they dive into Doctrine internals or real project debugging?
Also:
How can I best prepare to make the most of the time?
Any questions I should ask them at the end?
Appreciate any tips, experiences, or resources 🙌
https://redd.it/1lmxgmr
@r_php
Reddit
From the symfony community on Reddit
Explore this post and more from the symfony community
I offer intro to Computer Programming Class. This is my Syllabus
Just wanted to share my syllabus for the class (you can even call it a bootcamp, that’s fine)
As an educator, or a student or a developer…what do you think? Do you think it’s solid? Any improvements? Should I add or omit anything.
Thanks in advance
Here it is: https://www.figma.com/proto/OpYXeDpozG4CPae139TEna?node-id=1-2&locale=en
https://redd.it/1ln5x0p
@r_php
Just wanted to share my syllabus for the class (you can even call it a bootcamp, that’s fine)
As an educator, or a student or a developer…what do you think? Do you think it’s solid? Any improvements? Should I add or omit anything.
Thanks in advance
Here it is: https://www.figma.com/proto/OpYXeDpozG4CPae139TEna?node-id=1-2&locale=en
https://redd.it/1ln5x0p
@r_php
Figma
Unnoscriptd
Created with Figma
A Week of Symfony #965 (June 23–29, 2025)
https://symfony.com/blog/a-week-of-symfony-965-june-23-29-2025?utm_source=Symfony%20Blog%20Feed&utm_medium=feed
https://redd.it/1ln99i9
@r_php
https://symfony.com/blog/a-week-of-symfony-965-june-23-29-2025?utm_source=Symfony%20Blog%20Feed&utm_medium=feed
https://redd.it/1ln99i9
@r_php
Symfony
A Week of Symfony #965 (June 23–29, 2025) (Symfony Blog)
This week, Symfony 6.4.23, 7.2.8 and 7.3.1 maintenance versions were released. Meanwhile, the upcoming Symfony 7.4 version continued adding new features such as better controller helpers, more precisi…