=== TINXDK Log Viewer Lite ===
Contributors: tinxdk
Tags: debug log, error log, debug.log, log viewer, troubleshooting
Requires at least: 6.3
Tested up to: 7.1
Requires PHP: 8.2.35
Stable tag: 2.0.1
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

View, search and colour-code the WordPress debug log, newest first, without loading a huge log file into memory.

== Description ==

TINXDK Log Viewer Lite shows the end of your WordPress debug log under **Tools > Log Viewer**, newest entry first and colour-coded by level (error/fatal, warning, notice, deprecated, other). Only the last N lines are read from the file (default 500, maximum 5000), so a log of several gigabytes does not exhaust PHP memory.

* View `wp-content/debug.log` (or the path in `WP_DEBUG_LOG` when it is a path), newest first, last N lines only.
* Colour coding by level and text search across whole entries.
* Stack traces are shown under the timestamped line they belong to (can be switched off).
* File size and last modified time; clear messages when the file is missing, empty or unreadable.
* Indicator when `WP_DEBUG` or `WP_DEBUG_LOG` is off, with the line to add to wp-config.php.
* Settings: number of lines to read and grouping of stack traces.
* Multisite: network-activate the plugin; the page is then found under Network admin > Settings > Log Viewer and needs the `manage_network_options` capability.
* Danish translation included.

The plugin only reads the log. It never changes or deletes a log file, never sends data anywhere and has no public forms.

**Need more?** The separate add-on [TINXDK Log Viewer Pro](https://tinxdkcloud.dk/wordpress-plugins/tinxdk-log-viewer/#pro) (licence from tinxdkcloud.dk, not part of this plugin) adds more log files (PHP `error_log`, `php_error.log`, `wp-content/error.log`, WooCommerce logs), a level filter, download, clear, auto-refresh and a dashboard widget. This plugin offers hooks for it (`tinxdk_lv_sources`, `tinxdk_lv_entries`, `tinxdk_lv_toolbar_fields`, `tinxdk_lv_toolbar_actions`, `tinxdk_lv_admin_tabs`, `tinxdk_lv_admin_sections`, `tinxdk_lv_settings_defaults`, `tinxdk_lv_sanitize_settings`, `tinxdk_lv_loaded`).

If the old "OpenDIMS WP LogViewer" plugin is still active, an admin notice asks you to deactivate it.

== Installation ==

1. Upload the plugin folder to `/wp-content/plugins/` or install it from the Plugins screen, then activate it.
2. Open Tools > Log Viewer. To get a log, add `define( 'WP_DEBUG', true ); define( 'WP_DEBUG_LOG', true ); define( 'WP_DEBUG_DISPLAY', false );` to wp-config.php.

== Frequently Asked Questions ==

= Does it read the whole log file? =

No. The file is read backwards in small chunks until the last N lines are found (or 8 MB have been read), so a very large log costs the same as a small one.

= Where is the log file? =

`wp-content/debug.log`, or the path you set with `define( 'WP_DEBUG_LOG', '/path/to/file.log' );`. The plugin tells you when `WP_DEBUG` or `WP_DEBUG_LOG` is off.

= Can I view the PHP error log or the WooCommerce logs? =

Not in this plugin. That is what the separate TINXDK Log Viewer Pro add-on does. It uses a whitelist: only files the add-on lists can be chosen, never an arbitrary path from the request.

= Does the plugin contact any external service? =

No.

= Is it a replacement for "TINXDK WP Log Viewer" or "OpenDIMS WP LogViewer"? =

Yes. Version 2.0.0 is the new, renamed plugin (see the changelog). Deactivate the old plugin.

== Changelog ==

= 2.0.1 =
* Changed: Renamed to TINXDK Log Viewer Lite (no functional change). Slug, settings and data are unchanged.

= 2.0.0 =
* Split into two plugins: this plugin (free, WordPress.org) and the separate add-on TINXDK Log Viewer Pro (extra log files, level filter, download, clear, auto-refresh, dashboard widget, licence and updates from tinxdkcloud.dk). All licence and updater code moved out of this plugin.
* Renamed from `tinxdk-wp-log-viewer` to `tinxdk-log-viewer`. Settings (`tinxdk_lv_settings`) are kept.
* New extension points for add-ons: `tinxdk_lv_sources`, `tinxdk_lv_entries`, `tinxdk_lv_toolbar_fields`, `tinxdk_lv_toolbar_actions`, `tinxdk_lv_admin_tabs`, `tinxdk_lv_admin_sections`, `tinxdk_lv_settings_defaults`, `tinxdk_lv_sanitize_settings`, `tinxdk_lv_loaded`.
* A dismissible note about the Pro add-on on the plugin page and a "Pro" link in the plugin row.
* Translations are loaded by WordPress (no `load_plugin_textdomain()` call).

= 1.0.0 =
* First release (as `tinxdk-wp-log-viewer`): replaces "OpenDIMS WP LogViewer". Tail-only reading, newest first, colour coding, search, grouped stack traces and the WP_DEBUG indicator.

== Upgrade Notice ==

= 2.0.1 =
Renamed to TINXDK Log Viewer Lite (no functional change).

= 2.0.0 =
The licensed features moved to the separate plugin TINXDK Log Viewer Pro. Install it from tinxdkcloud.dk if you used a licence; this plugin keeps working on its own.
