controlErrorLog

Управление журналом ошибок
Версия 1.4.6-pl
Дата выпуска 22.01.2022
Загрузки 5 640
Просмотры 13 531
Решение для контроля за журналом ошибок. Включает в себя иконку в панели меню и уведомление по электронной почте.





Как видно из картинки, справа, рядом с именем администратора, появилась иконка. Если журнал содержит ошибки, то отображается восклицательный знак в желтом треугольнике. Если ошибок нет, то отображается галочка в белом кружке.

Чтобы открыть журнал ошибок, кликаем на иконке.

Если журнал слишком большой, то выводится только последние 15 строчек и предлагается скачать его полную версию. Количество последний строчек меняется в настройках.



За все за это отвечает плагин, срабатывающий по событию OnManagerPageBeforeRender.

Индикатор ошибок видят только администраторы с «sudo» и пользователи с правами «error_log_view». Это для того, чтобы обычные редакторы не пужались. Добавлю еще, что для очистки журнала обычным пользователям нужны права «error_log_erase».

Сделан в виде компонента для загрузки через менеджер пакетов. Кто не хочет устанавливать пакет, может взять код плагина на Github, но там чуть меньше возможностей.

В версии 1.0.3 появились системные настройки:

  • last_lines — Определяет количество последний строчек журнала, если он слишком большой для показа. По-умолчанию, 15.
  • auto_refresh — Включает автообновление состояния журнала. Пригодится в случае, если долго не меняется страница в админке, а в журнале появляются ошибки с фронт-энда. Т.е. администратору не нужно открывать журнал, чтобы проверить, есть ли там ошибки.
  • refresh_freq — Частота обновления журнала, если включена опция auto_refresh. По-умолчанию, 60 секунд.
  • control_frontend — Выводить журнал ошибок на сайте.
  • admin_email — Почта администратора для уведомления. Если не указана, то уведомления не высылаются.

Проект на Github.

Обсуждение компонента в сообществе MODX.PRO.

1.4.6-pl

  • Fixed a bug with the incorrect Smarty compilation path (#31).

1.4.5-pl

  • Fixed a bug with updating the ControlErrorlog icon.
  • Fixed parsing for fatal errors.

1.4.4-pl

  • Removed the definition of the compilation path for Smarty.

1.4.3-pl

  • Fixed hashing of missing log file.
  • Optimized for MODX 3.

1.4.2-pl

  • Added check for user menu existence (#27).

1.4.1-beta

  • Added system setting "enable" to manage controlErrorLog in the backend.
  • Fixed a bug with the too large mode.
  • Return back PHP5 support.

1.4.0-beta

  • Added the ability to format the error log content.
  • Now the "control_frontend" system setting is responsible for displaying the error log on the frontend (useful for development mode).

1.3.1-pl

  • Added closing the window by clicking on the icon.

1.3.0-pl

  • Added the ability to control copies of the error log.

1.2.1-pl

  • Moved "Make a copy" button to the left.

1.2.0-pl (25.12.2017)

  • Added a button "Make a copy" which makes a copy of the error log with current timestamp in the name.
  • Changed the admin notification event from "OnHandleRequest" to "OnWebPageComplete".

1.1.3-pl (30.06.2017)

  • Fixed bug which occurs when the error log is bigger then allowed memory size [#14].

1.1.2-pl (11.12.2016)

  • Code optimization.
  • Added cron script for checking the error log (core/components/controlerrorlog/cron/checkerrorlog.php).

1.1.1-pl (10.04.2016)

  • Updated the Dutch lexicon.

1.1.0-pl (01.04.2016)

  • Added control of the error log in the frontend of the site and admin notification.

1.0.5-pl (21.09.2015)

  • Fixed bug with lexicon strings with some CMPs (#6)

1.0.4-pl (27.08.2015)

  • Fixed the bug #5.

1.0.3-pl (25.08.2015)

  • Now the error log is checked for errors every minute (by default). It can be switched off.
  • Add a system setting "Last lines".
  • Add a system setting "Refresh frequency".
  • Add a system setting "Auto refresh".
  • Some improvements - now the window closes with animation, refreshing the error log on opening the window.

1.0.2-pl (10.08.2015)

  • Removed the table creation script.

1.0.1-pl (31.07.2015)

  • Changed the appearance of the error indicator (Icons instead of text).
  • Now the error indicator is displayed only for users with permission "error_log_view".
  • Removed "Error Log" button.
  • Added language support for Dutch.

1.0.0-pl (30.07.2015)

  • Initial release

Последние обсуждения в сообществе MODX.pro