Log Viewer v3

Log Viewer v3 brings several quality of life features that I'm sure you will enjoy - different log format support, and email previews

Screenshot of Log Viewer v3 showcasing the new features - multiple log formats and email previews
Log Viewer v3 update - multiple log formats & email previews

The new Log Viewer has been silently out for a couple of weeks already, which helped iron out any bugs still found on a new release before announcing it to the bigger public. Well, it is now ready for wide adoption and it has some great new features!

Support for multiple log formats

Log Viewer can now view not just Laravel logs, but also Apache, Nginx, Redis, Postgres, Supervisor, and more. Here you can see the types of logs that are now supported by Log Viewer out of the box.

Showing these logs in the new Log Viewer is as easy as adding the paths to your logs in the config/log-viewer.php configuration, like so:

    /*
    |--------------------------------------------------------------------------
    | Include file patterns
    |--------------------------------------------------------------------------
    |
    */

    'include_files' => [
        '*.log',
        '**/*.log',

        // You can include paths to other log types as well, such as apache, nginx, and more.
        '/var/log/httpd/*',
        '/var/log/nginx/*',

        // For example, logs can be found on MacOS Apple Silicon machines
        '/opt/homebrew/var/log/nginx/*',
        '/opt/homebrew/var/log/httpd/*',
        '/opt/homebrew/var/log/php-fpm.log',
        '/opt/homebrew/var/log/postgres*log',
        '/opt/homebrew/var/log/redis*log',
        '/opt/homebrew/var/log/supervisor*log',

        // '/absolute/paths/supported',
    ],

If you don't see a particular log format, don't worry - you can now define custom log formats which will allow you to browse these custom logs within the Log Viewer UI that you love. Defining custom logs also works for overriding the existing, built-in log formats. If, for example, your Laravel or HTTP logs are somehow different from factory defaults, you can extend the parser classes to include the custom modifications you've made. You can read all about extending log formats here.

Log type switcher

Supporting multiple types of logs means there a lot more... logs... To help find exactly what you're looking for, or to focus your search on particular log types, we have added a log type selector. The selector will show up as soon as Log Viewer finds more than one type of log.

Screenshot of Log Viewer with a dropdown for selecting which log types to show, i.e. Supervisor, Postgres, Laravel, etc.
You can show/hide certain log types in Log Viewer

Email previews

How often do you use the log mail driver? I know I don't, simply because it's very difficult to read these raw emails with headers and MIME parts, much less see how they actually look. I've always opted in for other solutions like Mailtrap, Helo, or just sending real emails.

Well, all the other tools require additional setup, separate apps, or can be plain dangerous in test environments (ever sent a test email to a real person by mistake?)

The log mail driver is the simplest, and safest approach to sending emails locally. It becomes even more useful with Log Viewer v3, which brings email previews directly within the Log Viewer:

Screenshot of Log Viewer showcasing the feature of email previews
Email previews in Log Viewer

All you need to make this work is to set this in your .env:

MAIL_MAILER=log

The emails you send will instead be logged to your Laravel log, and they will then be viewable within the Log Viewer. Nifty little feature, don't you think? :)

Upgrading

Log Viewer v3 is an easy upgrade without any breaking changes for most users. You can learn how to upgrade from v2 to v3 here. The documentation has been updated for Log Viewer v3.

Questions / Feedback

If you have any questions, issues, bugs to report - please send them directly to the project's GitHub page - issues or discussions.

GitHub - opcodesio/log-viewer: Fast and beautiful Log Viewer for Laravel
Fast and beautiful Log Viewer for Laravel. Contribute to opcodesio/log-viewer development by creating an account on GitHub.

And if you like what you see and want to be notified of future updates to Log Viewer - please subscribe to the newsletter below.

Support

If you enjoy using this free, open-source project, there's several ways you can give back:

  • Submit a PR - fix a bug, add a new feature, refactor code. All PRs are welcome.
  • Add support for additional log formats - there's tons of different log formats in the world, and the more we can support in the Log Viewer - the better. Submit a PR with a new format support.
  • Buy me a coffee! ☕️ I'm an avid coffee drinker, which helps me work through the weekends after my full-time job to provide you with the Log Viewer for free :)