Skip to content
This repository has been archived by the owner on Apr 24, 2023. It is now read-only.

Commit

Permalink
v1.3.3
Browse files Browse the repository at this point in the history
  • Loading branch information
AlekVolsk committed Feb 20, 2019
1 parent ad4573f commit dc783be
Show file tree
Hide file tree
Showing 15 changed files with 451 additions and 436 deletions.
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
# View logs

![Github Releases](https://img.shields.io/github/downloads/AlekVolsk/com_vlogs/latest/total.svg)

### Component view the saved logs of core and extensions Joomla
## Component view the saved logs of core and extensions Joomla

**Scope**:

Expand All @@ -18,16 +16,18 @@

- (upd 1.2.0) reading PHP error log file (provided that it is installed in php.ini and available for reading from the site)

- (upd 1.3.0) archiving a log file to an archive with a log file name + current datetime (assuming the php-zip extension is connected), the log file is not cleared or deleted, the archive is saved to the site folder specified in the component settings, by default / tmp
- (upd 1.3.0) archiving a log file to an archive with a log file name + current datetime (assuming the php-zip extension is connected), the archive is saved to the site folder specified in the component settings, by default `/tmp`, where optionally deleting the original file after archiving is also configured

**Requirements**:

- Joomla 3.2 or later (com_ajax involved)

- PHP 5.6 or later

**Disadvantage**: the log file is read and displayed entirely, if it is large, it will take time, create a load on resources and traffic, so <br>**Recommendation for extension developers**: with intensive logging provide avtorezina logs into parts, task types, period, either, but that logs your not weighed megatons
**Disadvantage**: the log file is read and displayed entirely, if it is large, it will take time, create a load on resources and traffic, so

**Recommendation for extension developers**: with intensive logging provide avtorezina logs into parts, task types, period, either, but that logs your not weighed megatons

<img src="https://image.prntscr.com/image/pbf3-h1UT8G8QvcGtZ3Hbw.png">
![screen](https://image.prntscr.com/image/pbf3-h1UT8G8QvcGtZ3Hbw.png)

About how the native extension to use logging, see the Joomla documentation: https://docs.joomla.org/Using_JLog#Logging_a_specific_log_file
6 changes: 3 additions & 3 deletions README.ru.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# View logs

### Компонент просмотра сохраненных логов ядра и расширений Joomla
## Компонент просмотра сохраненных логов ядра и расширений Joomla

**Возможности**:

Expand All @@ -16,7 +16,7 @@

- (upd 1.2.0) чтение файла лога ошибок PHP (при условии, что он установлен в php.ini и доступен для чтения с сайта)

- (upd 1.3.0) архивирование файла лога в архив с именем файла лога + текущая дата и время (при условии подключенного расширения php-zip), файл лога при этом не очищается и не удаляется, архив сохраняется в папку сайта, указанную в параметрах компонента, по умолчанию /tmp.
- (upd 1.3.0) архивирование файла лога в архив с именем файла лога + текущая дата и время (при условии подключенного расширения php-zip), архив сохраняется в папку сайта, указанную в параметрах компонента, по умолчанию `/tmp`, где также настраивается опциональное удаление исходного файла после архивирования

**Требования**:

Expand All @@ -28,6 +28,6 @@

**Рекомендация разработчикам расширений**: при интенсивном логировании предусмотрите авторазбиение логов на части, по типам задач, по периода, еще как-либо, но чтобы логи ваши не весили мегатонны

<img src="https://image.prntscr.com/image/pbf3-h1UT8G8QvcGtZ3Hbw.png">
![screen](https://image.prntscr.com/image/pbf3-h1UT8G8QvcGtZ3Hbw.png)

О том, как в собственном расширении использовать логирование, можно узнать из документаци Joomla: https://docs.joomla.org/Using_JLog#Logging_a_specific_log_file
4 changes: 4 additions & 0 deletions admin/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
<fieldset name="global" label="JGLOBAL_FIELDSET_OPTIONS">
<field name="slen" type="text" label="COM_VLOGS_PRM_STRLEN" class="inputbox" default="32768"/>
<field name="apath" type="fileselect" folder="/" folderonly="true" label="COM_VLOGS_PRM_ARCHPATH" class="inputbox" default="tmp" addfieldpath="/administrator/components/com_vlogs/models/fields"/>
<field name="delafterarch" type="list" label="COM_VLOGS_PRM_DELAFTERARCH" default="0">
<option value="0">JNO</option>
<option value="1">JYES</option>
</field>
</fieldset>
<fieldset name="permissions" label="JCONFIG_PERMISSIONS_LABEL" description="JCONFIG_PERMISSIONS_DESC">
<field name="rules" type="rules" label="JCONFIG_PERMISSIONS_LABEL" validate="rules" filter="rules" component="com_vlogs" section="component"/>
Expand Down
20 changes: 6 additions & 14 deletions admin/controller.php
Original file line number Diff line number Diff line change
@@ -1,33 +1,25 @@
<?php defined( '_JEXEC' ) or die;
/*
* @package com_vlogs
* @copyright Copyright (C) 2018 Aleksey A. Morozov (AlekVolsk). All rights reserved.
* @license GNU General Public License version 3 or later; see http://www.gnu.org/licenses/gpl-3.0.txt
*/
<?php defined('_JEXEC') or die;

class VlogsController extends JControllerLegacy
{
function display( $cachable = false, $urlparams = [] )
function display($cachable = false, $urlparams = [])
{
$this->default_view = 'items';
parent::display( $cachable, $urlparams );
parent::display($cachable, $urlparams);
return $this;
}

public function getAjax()
{
$input = JFactory::getApplication()->input;
$model = $this->getModel('ajax');
$action = $input->getCmd('action');
$action = filter_input(INPUT_GET, 'action');
$reflection = new ReflectionClass($model);
$methods = $reflection->getMethods(ReflectionMethod::IS_PUBLIC);
$methodList = array();
foreach ($methods as $method)
{
foreach ($methods as $method) {
$methodList[] = $method->name;
}
if (in_array($action, $methodList))
{
if (in_array($action, $methodList)) {
$model->$action();
}
exit;
Expand Down
5 changes: 0 additions & 5 deletions admin/controllers/items.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
<?php defined('_JEXEC') or die;
/*
* @package com_vlogs
* @copyright Copyright (C) 2018 Aleksey A. Morozov (AlekVolsk). All rights reserved.
* @license GNU General Public License version 3 or later; see http://www.gnu.org/licenses/gpl-3.0.txt
*/

class VlogsControllerItems extends JControllerAdmin
{
Expand Down
4 changes: 3 additions & 1 deletion admin/language/en-GB/en-GB.com_vlogs.ini
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ COM_VLOGS_DESC="Component view the saved logs of core and extensions Joomla"

COM_VLOGS_PRM_STRLEN="The length of the string log file"
COM_VLOGS_PRM_ARCHPATH="Path to the log archives folder"
COM_VLOGS_PRM_DELAFTERARCH="Delete source file after archiving"

COM_VLOGS_DATA_EMPTY="Data is empty."
COM_VLOGS_COUNT_ITEMS_VIEW="Showing records: "
Expand All @@ -26,7 +27,8 @@ COM_VLOGS_NO_DELETE_PHP_LOG="You can't delete a PHP log file from the site admin
COM_VLOGS_ARCHIVEFILE_BUTTON="Archive active log"
COM_VLOGS_ARCHIVEFILE_NO_FOLDER="Log Archive Storage Folder not specified"
COM_VLOGS_ARCHIVEFILE_NO_EXISTS_FOLDER="Log Archive Storage Folder does not exist"
COM_VLOGS_ARCHIVEFILE_ALERT="Log file <strong>%s</strong> successfully packaged in <strong>%s</strong>.<br>Please note: the source file is not deleted or cleared."
COM_VLOGS_ARCHIVEFILE_ALERT_0="Log file <strong>%s</strong> successfully packaged in <strong>%s</strong>.<br>The source file has not been deleted or cleaned."
COM_VLOGS_ARCHIVEFILE_ALERT_1="Log file <strong>%s</strong> successfully packaged in <strong>%s</strong>.<br>The source file has been deleted."
COM_VLOGS_NO_ARCHIVE_PHP_LOG="You can't archive a PHP file log from the site administration panel. Please use the control panel or the console of your server."
COM_VLOGS_NO_PHPZIP="The php-zip library is not installed, archiving is not possible."
COM_VLOGS_ARCHIVEFILE_ERROR_CREATE="Error creating archive file %s."
8 changes: 5 additions & 3 deletions admin/language/ru-RU/ru-RU.com_vlogs.ini
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ COM_VLOGS_DESC="Компонент просмотра сохраненных л

COM_VLOGS_PRM_STRLEN="Длина строки файла лога"
COM_VLOGS_PRM_ARCHPATH="Путь к папке архивов логов"
COM_VLOGS_PRM_DELAFTERARCH="Удалять исходный файл после архивации"

COM_VLOGS_DATA_EMPTY="Нет данных для отображения: список пуст."
COM_VLOGS_COUNT_ITEMS_VIEW="Показано записей: "
Expand All @@ -22,11 +23,12 @@ COM_VLOGS_DOWNLOAD_BOM_BUTTON="Скачать как CSV (для MS Excel)"
COM_VLOGS_DELETEFILE_BUTTON="Удалить файл лога"
COM_VLOGS_DELETEFILE_SUCCESS="Файл <strong>%s</strong> успешно удален."
COM_VLOGS_DELETEFILE_ALERT="Ошибка удаления файла. Удалите файл фручную."
COM_VLOGS_NO_DELETE_PHP_LOG="Нельзя удалить файл лога PHP из административной панели сайта. Пожалуйста, воспользуйтесь для этого панелью управлением или консолью вашего сервера."
COM_VLOGS_NO_DELETE_PHP_LOG="Нельзя удалить файл лога PHP из административной панели сайта. Пожалуйста, воспользуйтесь для этого консолью или панелью управлением вашего сервера."
COM_VLOGS_ARCHIVEFILE_BUTTON="Архирировать текущий лог"
COM_VLOGS_ARCHIVEFILE_NO_FOLDER="Папка хранения архивов логов не указана"
COM_VLOGS_ARCHIVEFILE_NO_EXISTS_FOLDER="Папка хранения архивов логов не существует"
COM_VLOGS_ARCHIVEFILE_ALERT="Файл лога <strong>%s</strong> успешно упакован в <strong>%s</strong>.<br>Обратите внимание: исходный файл не удаляется и не очищается."
COM_VLOGS_NO_ARCHIVE_PHP_LOG="Нельзя архивировать файллога PHP из административной панели сайта. Пожалуйста, воспользуйтесь для этого панелью управлением или консолью вашего сервера."
COM_VLOGS_ARCHIVEFILE_ALERT_0="Файл лога <strong>%s</strong> успешно упакован в <strong>%s</strong>.<br>Исходный файл не был удален или очищен."
COM_VLOGS_ARCHIVEFILE_ALERT_1="Файл лога <strong>%s</strong> успешно упакован в <strong>%s</strong>.<br>Исходный файл был удален."
COM_VLOGS_NO_ARCHIVE_PHP_LOG="Нельзя архивировать файл лога PHP из административной панели сайта. Пожалуйста, воспользуйтесь для этого консолью или панелью управлением вашего сервера."
COM_VLOGS_NO_PHPZIP="Библиотекак php-zip не установлена, архивирование невозможно."
COM_VLOGS_ARCHIVEFILE_ERROR_CREATE="Ошибка создания файла архива %s."
Loading

0 comments on commit dc783be

Please sign in to comment.