Other configuration options
Before you're able to configure this, make sure to first publish the configuration file.
There are a few other, minor configuration options that don't affect Log Viewer usage as much.
"Back to ..." link configuration
You'll often want a quick way to get back to your main administration panel, or to the app. Log Viewer includes a simple configuration option to set that link and its text.
/* |-------------------------------------------------------------------------- | Back to system URL |-------------------------------------------------------------------------- | When set, displays a link to easily get back to this URL. | Set to `null` to hide this link. | | Optional label to display for the above URL. | */ 'back_to_system_url' => config('app.url', null), 'back_to_system_label' => null,
Shorter stack traces
Exception stack traces inside error logs can be very noisy. Often times you only need to see parts of the trace that are from your application code, not vendor code.
Log Viewer UI provides a setting to turn on/off shorter stack traces. By default, it strips away Laravel framework and Laravel DebugBar entries from the stack trace. If there are additional traces you would like to skip, you can configure them in the config/log-viewer.php
:
/* |-------------------------------------------------------------------------- | Shorter stack trace filters. |-------------------------------------------------------------------------- | Lines containing any of these strings will be excluded from the full log. | This setting is only active when the function is enabled via the user interface. | */ 'shorter_stack_trace_excludes' => [ '/vendor/symfony/', '/vendor/laravel/framework/', '/vendor/barryvdh/laravel-debugbar/', ],
Front-end configuration defaults
There are multiple options possible in the front-end, such as sort order of files, logs, items per page, etc.
By default, these are kept in the user browser's localStorage
so that changes are persisted through page reloads.
It's possible to re-configure the defaults, and also disable the localStorage
use entirely. You can do so
in the "defaults"
section of the Log Viewer config:
/* |-------------------------------------------------------------------------- | Default settings for Log Viewer |-------------------------------------------------------------------------- | These settings determine the default behaviour of Log Viewer. Many of | these can be persisted for the user in their browser's localStorage, | if the `use_local_storage` option is set to true. | */ 'defaults' => [ // Whether to use browser's localStorage to store user preferences. // If true, user preferences saved in the browser will take precedence over the defaults below. 'use_local_storage' => true, // Method to sort the folders. Other options: `Alphabetical`, `ModifiedTime` 'folder_sorting_method' => FolderSortingMethod::ModifiedTime, // Order to sort the folders. Other options: `Ascending`, `Descending` 'folder_sorting_order' => SortingOrder::Descending, // Order to sort the logs. Other options: `Ascending`, `Descending` 'log_sorting_order' => SortingOrder::Descending, // Number of results per page. Must be one of the above `per_page_options` values 'per_page' => 25, // Color scheme for the Log Viewer. Other options: `System`, `Light`, `Dark` 'theme' => Theme::System, // Whether to enable `Shorter Stack Traces` option by default 'shorter_stack_traces' => false, ],
Global search chunking
When searching across all files, Log Viewer scans the files in chunks, so that you can get feedback on how many files have been searched and how much remains to be searched.
You can configure the chunk size (in megabytes) inside config/log-viewer.php
:
/* |-------------------------------------------------------------------------- | Chunk size when scanning log files lazily |-------------------------------------------------------------------------- | The size in MB of files to scan before updating the progress bar when searching across all files. | */ 'lazy_scan_chunk_size_in_mb' => 200,