A Laravel Nova tool to manage and keep track of each one of your logs files.

Overview

Nova tool to for logs

Latest Version on Packagist Total Downloads

A Laravel Nova tool to manage and keep track of each one of your logs files.

Original repository https://github.com/KABBOUCHI/nova-logs-tool

screenshot of the logs tool

Installation

You can install the package in to a Laravel app that uses Nova via composer:

composer require stepanenko3/nova-logs-tool

Next up, you must register the tool with Nova. This is typically done in the tools method of the NovaServiceProvider.

// in app/Providers/NovaServiceProvder.php

// ...

public function tools()
{
    return [
        // ...
        new \Stepanenko3\LogsTool\LogsTool(),
    ];
}

Publish the package configuration file.

php artisan vendor:publish --provider="Stepanenko3\LogsTool\LogsToolServiceProvider"

Authorization

// in app/Providers/NovaServiceProvder.php

// ...

public function tools()
{
    return [
        // ...
        // don't return plain `true` value or anyone can see/download/delete the logs, make sure to check if user has permission.
        (new \Stepanenko3\LogsTool\LogsTool())
                ->canSee(function ($request) {
                    return auth()->user()->canSee(); 
                })
                ->canDownload(function ($request) {
                    return  auth()->user()->canDownload();
                })
                ->canDelete(function ($request) {
                    return false;
                }),
    ];
}

Usage

Click on the "nova-logs-tool" menu item in your Nova app to see the tool provided by this package.

Possible environment variables:

NOVA_LOGS_PER_PAGE=6
NOVA_LOGS_REGEX_FOR_FILES="/^laravel/"

Screenshots

screenshot of the logs tool

screenshot of the logs tool

screenshot of the logs tool

screenshot of the logs tool

Testing

composer test

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Credits

The MIT License (MIT). Please see License File for more information.

Comments
  • No such log file Exception

    No such log file Exception

    The package makes it possible to delete the log file, but at the same time, it throws an exception if the log is not found.

    if (!File::exists($file)) {
        throw new Exception('No such log file');
    }
    

    I suggest not throwing an exception.

    opened by abordage 4
  • Error: A function with return type must return a value

    Error: A function with return type must return a value

    PHP 8.1.6 Laravel 9.18.0 Nova 4.10.0

    {
        "message": "A function with return type must return a value",
        "exception": "Symfony\\Component\\ErrorHandler\\Error\\FatalError",
        "file": ".\\vendor\\stepanenko3\\nova-logs-tool\\src\\LogsService.php",
        "line": 95,
        "trace": []
    }
    

    From:

            if (File::size($logFile) > self::MAX_FILE_SIZE) {
                return;
            }
    

    To:

            if (File::size($logFile) > self::MAX_FILE_SIZE) {
                return [];
            }
    

    seems to resolve the error

    P.S. Thank you for this awesome package!

    opened by hoczeus 4
  • Displaying latest log messages on a Nova dashboard (possible documentation addition?)

    Displaying latest log messages on a Nova dashboard (possible documentation addition?)

    I was looking into displaying log messages on my Nova dashboard using the new Table metric introduced in V4.

    I took a look at how this package gets data from logs and realised I could piggyback off it very easily!

    Below is all that was needed to display the latest three lines from laravel.log (this is from the 'calculate' method of my table metric)

            $lines = array_slice(Stepanenko3\LogsTool\LogsService::all("laravel.log"), 0, 3);
            foreach ($lines as $line) {
                $rows[] = MetricTableRow::make()
                    ->icon(
                        $line["level_img"]
                    )
                    ->iconClass(
                        $line["level_class"]
                    )
                    ->title($line["text"])
                    ->subtitle(
                        \Carbon\Carbon::create($line["date"])->diffForHumans()
                    );
            }
            return $rows;
        
    
    

    and here's the result:

    Screenshot 2022-07-25 at 10 58 35

    opened by johnpuddephatt 2
  • Menu Section localization

    Menu Section localization

    Hello! Thank you for your package! Please help me to understand how can I localize menu section in new nova v4? In version 3 it was made by en.json file in lang folder. But now (on v4) there is no effect ... Thanks!

    opened by pavloniym 1
  • Menue item is collapsable which is not clickable on browser

    Menue item is collapsable which is not clickable on browser

    Hello, Thanks for the Nova4 support. I used this package when was updating to silver surfer. I am now using latest 1.1.5 and can see an issue that the menueSection is collapsable. Which is not clickable on browser.

    Can you please fix the issue or you can help me if i am missing something.

    Many Thanks

    opened by msalmanshahid 1
  • Update colours to work with Nova 4

    Update colours to work with Nova 4

    Nova 4 uses Tailwind in JIT mode, so only colours used within the Nova codebase are present in the CSS file.

    Changing the colours to match those already used elsewhere in Nova makes the colours work again.

    opened by johnpuddephatt 0
  • Update colours to work with Nova 4

    Update colours to work with Nova 4

    Nova 4 uses Tailwind in JIT mode. As a result of this only colours used by Nova are present in the stylesheet.

    This commit updates the colours used by this tool to ones that are present in the Nova stylesheet.

    opened by johnpuddephatt 0
  • Attempt to read property

    Attempt to read property "name" on null

    The error occurs immediately after deleting the log file.

    Attempt to read property "name" on null {"userId":1,"exception":"[object] (ErrorException(code: 0): Attempt to read property \"name\" on null at \\vendor\\stepanenko3\\nova-logs-tool\\src\\Http\\Controllers\\LogsController.php:42)

    opened by Metilar 1
  •  Undefined array key 1

    Undefined array key 1

    [2022-08-29 11:44:34] local.ERROR: Undefined array key 1 {"userId":1,"exception":"[object] (ErrorException(code: 0): Undefined array key 1 at /var/www/html/vendor/stepanenko3/laravel-log-viewer/src/Helpers/Log.php:48)

    opened by nw-mjl 3
Releases(v2.0.2)
Owner
Artem Stepanenko
25 y.o. Web Developer 👨🏻‍💻 instagram.com/stepanenko3
Artem Stepanenko
It's the same as Google Keep but you can have unlimited subtasks for each and every one of your main tasks!

SAD-KEEP It's the same as Google Keeps but you can have unlimited subtasks for each and every one of your main tasks! You can see it live: Sad-keep de

Sadaf 2 Aug 6, 2022
This Laravel Nova package allows you to manage media and media fields.

Nova Media Hub This Laravel Nova package allows you to manage media and media fields. Requirements php: >=8.0 laravel/nova: ^4.0 Features Media Hub UI

outl1ne 25 Dec 22, 2022
Display & customize video formatted files with ease on Laravel Nova

Video Field for Laravel Nova Upload and display videos in laravel nova This package is an extended version of built-in nova file field that helps you

Mostafa Zeinivand 12 Nov 8, 2022
App that performs CRUD operations in which users can track projects, tasks under projects, total duration of each project and task. Project is being build with Nuxt js 3, Axios, Pinia, Bootstrap 5 and Vue composition API

Nuxt 3 Minimal Starter Look at the nuxt 3 documentation to learn more. Setup Make sure to install the dependencies: # yarn yarn install # npm npm ins

Sergio Terrero 2 Nov 1, 2022
View Laravel File-Based Logs In Web

View Laravel/Lumen logs in browser. Disclaimer This package is simply a lightweight web interface for Laravel and Lumen file-based logs. If you need a

mojtabaa hn 163 Sep 11, 2022
A DDL Countdown tools for a SUFE SIMEr to track down CS conference in tenure track list

A DDL ⏳ Countdown tools ?? for a SUFE SIMEr to track down CS conference in tenure track lists, which can retrieve conference through CCF and TierLevel rank ?? .

null 0 Apr 1, 2022
Grocery-organizer - Create grocery lists, Recipes, keep track of what ingredients you have/need

Vue-Fire-Tail ?? Demo Here: Vue-Fire-Tail Try Logging with the following Email Address: [email protected] Password: [email protected] Steps Why Vue Fire Tail T

Tom Corey 0 Jan 2, 2022
A Gui To Manage Laravel Translation Files

Lingo A file based translation manager, which unlike other Lang managers don't need a database connection to handle the translation. Installation comp

Muah 97 Jan 3, 2023
Crypto News allows you to convert cryptocurrencies, view latest news and exchange rates for each ICO – all the data from the world of cryptocurrencies in one place.

Crypto News Crypto News allows you to convert cryptocurrencies, view latest news and exchange rates for each ICO – all the data from the world of cryp

Bartosz Łaniewski 26 May 12, 2022
EasySNCF - This project deals primarily with train stations in France, giving details and insights about each one of them

HMI - Data Visualization Use the app · Demo on Google Drive To install the app D

null 0 Jan 19, 2022
Nova Kontainer - A Laravel Nove component that adds a file picker for Kontainer

Nova Kontainer Nova Kontainer is a Laravel Nove component that adds a file picker for Kontainer Features Select any image or video from Kontainer and

Jess Stopa 1 Feb 8, 2022
Laravel Nova Iframe Popup Field

Laravel Nova Iframe Popup Field With this field you create a button which displays an iframe in a popup (visually oriented to Inertia.js). Install com

Norman Huth 5 Jun 23, 2022
Viewer de l'émission avec les logs.

Underscore_ Logs Viewer Un petit site pour voir les logs d'Underscore_. Vue 3 + Typescript + Vite This template should help get you started developing

Micode 16 May 4, 2022
Viewer de l'émission avec les logs.

Underscore_ Logs Viewer Un petit site pour voir les logs d'Underscore_. Vue 3 + Typescript + Vite This template should help get you started developing

Micode 16 May 4, 2022
Create and manage invoices in your browser. Serverless Invoices is a free invoicing tool for freelancers and small businesses. Made with Vue.js.

Serverless Invoices by Moku Serverless Invoices is a free invoicing tool for freelancers and small businesses. It is open-source and easily extendable

null 370 Jan 3, 2023
Paperead A tiny tool to present and manage your reading and notes.

Paperead A tiny tool to present and manage your reading and notes.

StardustDL 5 Nov 16, 2021
Allows to connect your `Laravel` Framework translation files with `Vue`.

Laravel Vue i18n laravel-vue-i18n is a Vue3 plugin that allows to connect your Laravel Framework JSON translation files with Vue. It uses the same log

Francisco Madeira 358 Dec 26, 2022
🚀 Lanyard API plugin for Vue to easily track your Discord status. Supports REST and WebSocket methods.

?? Lanyard API plugin for Vue to easily track your Discord status. Supports REST and WebSocket methods.

EGGSY 30 Sep 3, 2022