<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Bright Robert</title>
    <description>The latest articles on Forem by Bright Robert (@guruskid).</description>
    <link>https://forem.com/guruskid</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F29633%2F022ddac1-38a7-42f8-b2ce-997f0d832cc8.png</url>
      <title>Forem: Bright Robert</title>
      <link>https://forem.com/guruskid</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/guruskid"/>
    <language>en</language>
    <item>
      <title>Laravel Real-Time Log Monitoring</title>
      <dc:creator>Bright Robert</dc:creator>
      <pubDate>Sun, 30 Jul 2023 12:05:58 +0000</pubDate>
      <link>https://forem.com/guruskid/laravel-real-time-log-monitoring-1l81</link>
      <guid>https://forem.com/guruskid/laravel-real-time-log-monitoring-1l81</guid>
      <description>&lt;p&gt;Professionally viewing Laravel logs is critical for identifying and debugging problems in your application. We can easily check our logs in local environments by saving them to local, but this is a time-consuming process in live environments.&lt;/p&gt;

&lt;p&gt;In this section, I'll show you packages that will provide you with a graphical user interface that will allow you to easily check all of our logs, such as errors, warnings, and debug messages. From there, we can also clear / delete our log files. Daily logs are preferable because they make it easier to trace logs.&lt;/p&gt;

&lt;p&gt;Let's look at how we can incorporate that package into our existing Laravel application.&lt;/p&gt;

&lt;h2&gt;
  
  
  Installation
&lt;/h2&gt;

&lt;p&gt;It is recommended to use the _opcodesio _ package for Laravel running on PHP 8 and higher.&lt;/p&gt;

&lt;p&gt;To use composer to install the package, type &lt;code&gt;composer require opcodesio/log-viewer&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;After installing the package, run &lt;code&gt;php artisan log-viewer:publish&lt;/code&gt; to publish the front-end assets.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Usage&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Once installed, you will be able to access Log Viewer directly from your browser.&lt;br&gt;
By default, the application is available at: &lt;code&gt;{APP_URL}/log-viewer&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;(for example: &lt;code&gt;http://{your-project}/log-viewer&lt;/code&gt;)&lt;/p&gt;

&lt;p&gt;It is recommended to use the &lt;code&gt;arcanedev&lt;/code&gt; package for Laravel running on PHP 7 and lower.&lt;/p&gt;

&lt;p&gt;You can install this package using Composer by issuing the following command: &lt;code&gt;composer require arcanedev/log-viewer:x.x&lt;/code&gt;, where &lt;code&gt;x.x&lt;/code&gt; is the compatible version for your Laravel version.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;composer require arcanedev/log-viewer&lt;/code&gt; for risk takes like me &lt;/p&gt;

&lt;p&gt;This for the version you are sure of&lt;br&gt;
&lt;code&gt;composer require arcanedev/log-viewer:~4.7.0&lt;/code&gt; for Laravel 5.8&lt;br&gt;
&lt;code&gt;composer require arcanedev/log-viewer:~4.6.0&lt;/code&gt; for Laravel 5.7&lt;br&gt;
&lt;code&gt;composer require arcanedev/log-viewer:~4.5.0&lt;/code&gt; for Laravel 5.6&lt;br&gt;
&lt;code&gt;composer require arcanedev/log-viewer:~4.4.0&lt;/code&gt; for Laravel 5.5&lt;br&gt;
&lt;code&gt;composer require arcanedev/log-viewer:~4.3.0&lt;/code&gt; for Laravel 5.4&lt;br&gt;
&lt;code&gt;composer require arcanedev/log-viewer:~4.2.0&lt;/code&gt; for Laravel 5 &amp;gt; 5.3&lt;/p&gt;

&lt;p&gt;Set this in your &lt;code&gt;.env&lt;/code&gt; file &lt;code&gt;APP_LOG=daily&lt;/code&gt; for Laravel 5.5 and below.&lt;/p&gt;

&lt;h3&gt;
  
  
  Artisan commands
&lt;/h3&gt;

&lt;p&gt;Run the following command to publish the configuration &lt;code&gt;php artisan log-viewer:publish&lt;/code&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  DONE!
&lt;/h1&gt;

&lt;p&gt;Go to &lt;code&gt;http://{your-project}/log-viewer&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;The error &lt;code&gt;join(): Passing glue string after array is deprecated&lt;/code&gt; might appear. If you want to view the log according to the date at &lt;code&gt;http://your-project/log-viewer/logs/2023-07-30&lt;/code&gt; you may receive a 504 Error or a 503 Error, depending on whether the debug mode is enabled in your &lt;code&gt;.env&lt;/code&gt; file.&lt;/p&gt;

&lt;h2&gt;
  
  
  Fix
&lt;/h2&gt;

&lt;p&gt;Go to your project directory locate &lt;code&gt;resources/views/vendor/log-viewer/bootstrap-4&lt;/code&gt; edit &lt;code&gt;show.blade.php&lt;/code&gt; find &lt;code&gt;join(log_styler()-&amp;gt;toHighlight(), '|')&lt;/code&gt; and replace with &lt;code&gt;join('|', log_styler()-&amp;gt;toHighlight())&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Enjoy the rest of your day as a programmer &lt;/p&gt;

</description>
      <category>laravel</category>
      <category>php</category>
      <category>webdev</category>
    </item>
  </channel>
</rss>
