customlogcreator / customlogging
The Laravel Custom Logging Package is a package that enhances your Laravel application's logging capabilities. It provides options to create custom log handlers, organize log files into folders, and upload logs to an Amazon S3 bucket.
Requires
- illuminate/support: ~9|~10
Requires (Dev)
- orchestra/testbench: ~7
- phpunit/phpunit: ~9.0
This package is auto-updated.
Last update: 2025-04-29 01:35:52 UTC
README
Documentation, Installation, and Usage Instructions
Installation
Via Composer
$ composer require customlogcreator/customlogging
$ php artisan vendor:publish --tag=customlogging
added in providers
$ CustomLogCreator\CustomLogging\CustomLoggingServiceProvider::class,
Usage Instructions
Log::channel('dynamic_logs')->info('Log message here');
Configuration
In the custom-logging.php configuration file, you can customize the behavior of the package by modifying the provided configuration array. Here are the configuration options:
-
namespace: The namespace where custom log handlers and formatters are located.
-
is_folder: Indicates whether a folder structure should be used for organizing log files.
-
folder_name: The name of the folder where log files will be stored when 'is_folder' is set to true.
-
path_name: The path name where log files will be stored when 'is_folder' is set to false.
-
is_upload_s3_bucket: Indicates whether log files should be uploaded to an Amazon S3 bucket.
-
aws_destination_path: The destination path in the S3 bucket where log files should be uploaded. This is applicable only when 'is_upload_s3_bucket' is set to true.
config/customlogging.php
return [
'is_directory' => true, // create new directory in logs folder
'directory_name' => '', // logs/01-01-2023/01-01-202.log
'path_name' => '', // 01-01-2023.log
'is_upload_s3_bucket' => false,
'aws_destination_path' => '',
];