All Projects → Edujugon → Laravel Log

Edujugon / Laravel Log

Licence: mit
Simple API to write logs for Laravel.

Projects that are alternatives of or similar to Laravel Log

Laravel Console Logger
Logging and Notifications for Laravel Console Commands.
Stars: ✭ 79 (+315.79%)
Mutual labels:  laravel, laravel-package, logger
Laravel Database Logger
Log database query sql in Laravel Application, support Guard,Auth to multiple file record
Stars: ✭ 31 (+63.16%)
Mutual labels:  laravel, laravel-package, logger
Laravel Shopify
A full-featured Laravel package for aiding in Shopify App development
Stars: ✭ 634 (+3236.84%)
Mutual labels:  laravel, laravel-package
Laravel Open Source Projects
A Web Artisan list of categorized OPEN SOURCE PROJECTS built with Laravel PHP Framework.
Stars: ✭ 676 (+3457.89%)
Mutual labels:  laravel, laravel-package
Chat
A Laravel chat package. You can use this package to create a chat/messaging Laravel application.
Stars: ✭ 710 (+3636.84%)
Mutual labels:  laravel, laravel-package
Laravel Visits
📊 Laravel Visits is a counter that can be attached to any model to track its visits using Redis or Eloquent. (with tags, IP protection and caching)
Stars: ✭ 582 (+2963.16%)
Mutual labels:  laravel, laravel-package
Laravel Tail
An artisan command to tail your application logs
Stars: ✭ 587 (+2989.47%)
Mutual labels:  laravel, log
Sweet Alert
A BEAUTIFUL, RESPONSIVE, CUSTOMIZABLE, ACCESSIBLE (WAI-ARIA) REPLACEMENT FOR JAVASCRIPT'S POPUP BOXES FOR LARAVEL
Stars: ✭ 696 (+3563.16%)
Mutual labels:  laravel, laravel-package
Framework
The truly Laravel E-commerce Framework
Stars: ✭ 456 (+2300%)
Mutual labels:  laravel, laravel-package
Twitter
Twitter API for Laravel 5.5+, 6.x, 7.x & 8.x
Stars: ✭ 755 (+3873.68%)
Mutual labels:  laravel, laravel-package
Laravel User Verification
PHP package built for Laravel 5.* to easily handle a user email verification and validate the email
Stars: ✭ 755 (+3873.68%)
Mutual labels:  laravel, laravel-package
Laravel Notify
Flexible Flash notifications for Laravel
Stars: ✭ 787 (+4042.11%)
Mutual labels:  laravel, laravel-package
Snooze
A package to simplify automating future notifications and reminders in Laravel
Stars: ✭ 515 (+2610.53%)
Mutual labels:  laravel, laravel-package
Laravel Decomposer
⚙️ A Laravel package to decompose your installed packages, their dependencies, your app & server environment
Stars: ✭ 488 (+2468.42%)
Mutual labels:  laravel, laravel-package
Laravel Options
Global key-value store in the database
Stars: ✭ 626 (+3194.74%)
Mutual labels:  laravel, laravel-package
Aimeos Laravel
Laravel ecommerce package for professional, ultra fast online shops, complex B2B applications and #gigacommerce
Stars: ✭ 5,204 (+27289.47%)
Mutual labels:  laravel, laravel-package
Laravel Heyman
Declarative style of authorization and validation in laravel.
Stars: ✭ 677 (+3463.16%)
Mutual labels:  laravel, laravel-package
Package Skeleton
📦 My base for PHP packages.
Stars: ✭ 6 (-68.42%)
Mutual labels:  laravel, laravel-package
Telegram
✈️ Telegram Notifications Channel for Laravel
Stars: ✭ 450 (+2268.42%)
Mutual labels:  laravel, laravel-package
Laravel Js Localization
🌐 Convert your Laravel messages and consume them in the front-end!
Stars: ✭ 451 (+2273.68%)
Mutual labels:  laravel, laravel-package

Laravel Log Package

Simple API to write logs for Laravel.

Installation

Type in console:
composer require edujugon/laravel-log

Laravel 5.5 or higher?

Then you don't have to either register or add the alias, this package uses Package Auto-Discovery's feature, and should be available as soon as you install it via Composer.

(Laravel < 5.5) Register the Log service by adding it to the providers array.

'providers' => array(
        ...
        Edujugon\Log\Providers\LogServiceProvider::class
    )
Publish the package's configuration file to the application's own config directory.
php artisan vendor:publish --provider="Edujugon\Log\Providers\LogServiceProvider" --tag="config"

The above command will generate a new file under your laravel app config folder called log.php

Configuration

Update the log.php file with your data.

API List

path

path method sets the path where create / storage the log file.

Syntax

Edujugon\Log\Log object path($path)

level

level method sets the logging level.

Available levels: emergency, alert, critical, error, warning, notice, info and debug.

Syntax

Edujugon\Log\Log object level($level)

title

title method sets the title or main message to be written.

Syntax

Edujugon\Log\Log object title($title)

line

line method sets a line below the title.

Notice that you can call this method as many time as lines you need to be written.

Syntax

Edujugon\Log\Log object line($line)

logname

name method sets the logger name.

By default this name is "my-logger"

Syntax

Edujugon\Log\Log object name($loggerName)

fileName

fileName method sets the file name.

Remember to put the name without any extension.

Syntax

Edujugon\Log\Log object fileName($name)

days

days method sets amount of days to be kept in server.

Syntax

Edujugon\Log\Log object days($days)

A value "0" means no day limit

withoutDateTime

withoutDateTime method excludes datetime from log line.

Syntax

Edujugon\Log\Log object withoutDateTime()

withoutLoggerDetails

withoutLoggerDetails method excludes logger details from log line.

Syntax

Edujugon\Log\Log object withoutLoggerDetails()

Exclude logger name and level

write

write method writes in log file.

Syntax

boolean write()

Usage samples

$log = new Log();
$log->fileName('my-personal-log')
    ->title('Stored new record')
    ->line('the record id is 3')
    ->line('Stored by John')
    ->line('This is antoher line')
    ->days(3)
    ->write();

Also can do it by its Facade:

Log::fileName('my-personal-log')
    ->title('Stored new record')
    ->line('the record id is 3')
    ->line('Stored by John')
    ->line('This is antoher line')
    ->write();
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].