tasmidur/kafka-monolog-handler
Larablocks Analysis
tasmidur/kafka-monolog-handler works with Laravel 8 and 9 (latest release v1.1.1, Sep 11, 2022), all past end of life (the last on Feb 6, 2024): no more fixes, even for security.
Recommendation checks
Not advisedNot advised: no release or commit in over 2 years.
- No release or commit in over 2 years
- Supports only Laravel 8 and 9, past end of life since Feb 6, 2024
- No release in the last 12 months (last: Sep 11, 2022)
- 4 downloads a month (needs 10,000)
- 5 GitHub stars (needs 100)
State
Likely abandoned- No release or commit in over 2 years.
- Last stable release: Sep 11, 2022.
- No releases in the last 12 months.
- First released: Sep 6, 2022.
- Monthly downloads: 4, down 69% from six months ago.
- 1 open issue on GitHub.
Data from Packagist and GitHub, checked by Larablocks on Dec 1, 2026.
| Install | |
|---|---|
composer require tasmidur/kafka-monolog-handler |
|
| Latest Version: | v1.1.1 |
| PHP: | ^8.0 |
| Laravel: | 8 · 9 |
| License: | MIT |
| Last Updated: | Jan 25, 2023 |
| Links: | GitHub · Packagist |
Kafka Monolog Handler
The "kafka-monolog-handler" package is a package for Laravel framework. This package allows you to send your Laravel application's log messages to a Kafka server using Monolog, a popular logging library for PHP.
The package provides a handler for Monolog that sends log messages to a Kafka topic. The package also includes a config file, where you can specify the host and port of your Kafka server, as well as the topic to which the log messages should be sent
Requirements
| Dependency | Requirement |
|---|---|
| php | >=8.0 |
| Laravel | >=8.0 |
This package also requires the rdkafka php extension, which you can install by following this documentation
Install
Install kafka-monolog-handler.
composer require tasmidur/kafka-monolog-handler
Get Started
1.Modify config/logging.php.
Without Kafka SASL Config
return [
'channels' => [
// ...
'kafka' => \Tasmidur\KafkaMonologHandler\KafkaLogger::getInstance(
topicName: env('KAFKA_LOG_FILE_TOPIC', 'laravel_logs'),
brokers: env('KAFKA_LOG_BROKERS')
),
],
];
With Kafka SASL Config and Log Formatter like ElasticsearchFormatter
return [
'channels' => [
// ...
'kafka' => \Tasmidur\KafkaLogger\KafkaLogger::getInstance(
topicName: env('KAFKA_LOG_FILE_TOPIC', 'system_logs'),
brokers: env('KAFKA_BROKERS'),
options: [
'is_sasl_apply' => env('IS_SASL_APPLY'), //true = applied or false= not apply
'sasl_config' => [
'username' => env('KAFKA_BROKER_USERNAME'),
'password' => env('KAFKA_BROKER_PASSWORD'),
'mechanisms' => env('KAFKA_BROKER_MECHANISMS'),
'security_protocol' => env('KAFKA_BROKER_SECURITY_PROTOCOL')
],
'formatter' => new ElasticsearchFormatter(
index: env('KAFKA_LOG_FILE_TOPIC', 'laravel_logs'),
type: "_doc")
]
),
],
];
2.Modify .env.
LOG_CHANNEL=kafka
KAFKA_BROKERS=kafka:9092,kafka:9093
KAFKA_LOG_FILE_TOPIC=laravel-logs
IS_SASL_APPLY=false
KAFKA_BROKER_USERNAME=username
KAFKA_BROKER_PASSWORD=password
KAFKA_BROKER_MECHANISMS=SCRAM-SHA-512
KAFKA_BROKER_SECURITY_PROTOCOL=SASL_SSL
License
Related Packages
Open Observe Monolog Handler is used for pushing laravel log into the OpenObserv...
ZincSearch Monolog Handler is used for pushing laravel log into the ZincSearch f...
Version History
| Version | Released | PHP | Laravel | License |
|---|---|---|---|---|
| v1.1.1 | ^8.0 | ^8.0| | MIT | |
| v1.1.0 | ^8.0 | ^8.0| | MIT | |
| v1.0.0 | ^8.0 | ^8.0| | MIT |