Pagina 1 din 1

phpBB3 Error Logging - logging al erorilor pentru phpBB3

Scris: 18-Oct-2007, 19:17:24
de ValceaForum
phpBB3 Error Logging Tool

Acest MOD genereaza un fisier numit "php_error.log" intr-un director ( /store/ directory ) care contine toate erorile generate in timpul utilizarii unui forum PhpBB3.
Este un mod deosebit de util pentru dezvoltatorii de stiluri si MODificari. Include si abilitatea de a loga posibile bug uri ale template urilor.

Exemplu al unui log:

Cod: Selectaţi tot

[08-Oct-2007  02:27:37] [phpBB Debug] [client 127.0.0.1][File preview.php] PHP Notice: in file/Applications/MAMP/htdocs/phpBB/mods/highwayoflife/stats_mod/preview.phpon line 37 : Undefined variable: sql
[08-Oct-2007  02:27:37] [phpBBDebug] [client 127.0.0.1] [File preview.php] PHP Notice: in file/Applications/MAMP/htdocs/phpBB/mods/highwayoflife/stats_mod/includes/db/mysqli.phpon line 213 : mysqli_fetch_assoc() expects parameter 1 to bemysqli_result, integer given
[08-Oct-2007  02:27:37] [phpBB Debug][client 127.0.0.1] [File preview.php] PHP Notice: in file/Applications/MAMP/htdocs/phpBB/mods/highwayoflife/stats_mod/includes/functions.phpon line 4221 : Cannot modify header information - headers already sentby (output started at /includes/functions.php:3728)
[08-Oct-2007 02:27:37] [phpBB Debug] [client 127.0.0.1] [File preview.php] PHPNotice: in file/Applications/MAMP/htdocs/phpBB/mods/highwayoflife/stats_mod/includes/functions.phpon line 4223 : Cannot modify header information - headers already sentby (output started at /includes/functions.php:3728)
[08-Oct-2007 02:27:37] [phpBB Debug] [client 127.0.0.1] [File preview.php] PHPNotice: in file/Applications/MAMP/htdocs/phpBB/mods/highwayoflife/stats_mod/includes/functions.phpon line 4224 : Cannot modify header information - headers already sentby (output started at /includes/functions.php:3728)
[08-Oct-2007 02:27:37] [phpBB Debug] [client 127.0.0.1] [File preview.php] PHPNotice: in file/Applications/MAMP/htdocs/phpBB/mods/highwayoflife/stats_mod/includes/functions.phpon line 4225 : Cannot modify header information - headers already sentby (output started at /includes/functions.php:3728)
-------------[ Begin General Error]-------------
[08-Oct-2007 20:25:27] [phpBB Error] [client 127.0.0.1] [file preview.php]/Applications/MAMP/htdocs/phpBB/mods/highwayoflife/stats_mod/includes/db/dbal.php:581
SQL ERROR [ mysqli ]
Unknown column 'user_admin' in 'field list' [1054]
SQL
SELECT user_admin FROM phpbb_users
BACKTRACE

FILE: includes/db/mysqli.php
LINE: 143
CALL: dbal->sql_error()
FILE: preview.php
LINE: 37
CALL: dbal_mysqli->sql_query()

-------------[ End of General Error]-------------

Instalare:

Se deschide

Cod: Selectaţi tot

/includes/functions.php
Se gaseste

Cod: Selectaţi tot

switch ($errno)
Se adauga inainte

Cod: Selectaţi tot

    $error_log = $phpbb_root_path . '/store/php_error.log';
Se gaseste

Cod: Selectaţi tot

case E_WARNING:
Se adauga dupa

Cod: Selectaţi tot





            if ((!defined('DEBUG_TEMPLATES') && strpos($errfile, 'template.') !== false) || (!defined('DEBUG_CACHE') && strpos($errfile, 'cache') !== false))
            {
                return;
            }
            
            $error_msg = str_replace(array(phpbb_realpath($phpbb_root_path), '\\'), array('', '/'), $msg_text);
            $error_timestamp = date('d-M-Y  H:i:s');
            $user_ip = $user->ip;
            $user_page = $user->page['page'];
            error_log("[$error_timestamp] [phpBB Debug] [client $user_ip] [File $user_page] PHP Notice: in file $errfile on line $errline : " . $error_msg . "\n", 3, $error_log);
Se gaseste

Cod: Selectaţi tot


$l_notify = '<p>Please notify the board administrator or webmaster: <a href="mailto:' . $config['board_contact'] . '">' . $config['board_contact'] . '</a></p>';
                }
            }

Se adauga dupa

Cod: Selectaţi tot


            $user_ip = (!empty($user)) ? $user->ip : ((!empty($_SERVER['REMOTE_ADDR'])) ? htmlspecialchars($_SERVER['REMOTE_ADDR']) : '');
            $user_page = (!empty($user)) ? $user->page['page'] : ((isset($_SERVER['PHP_SELF'])) ? $_SERVER['PHP_SELF'] : getenv('PHP_SELF'));
            $error_msg = html_entity_decode(strip_tags(str_replace(array('<br>', "\n\n"), "\n", $msg_text)));
            $error_timestamp = date('d-M-Y  H:i:s');
            error_log("-------------[ Begin $msg_title]-------------\n[$error_timestamp] [phpBB Error] [client $user_ip] [file $user_page] $errfile:$errline\n" . $error_msg . "-------------[ End of $msg_title]-------------\n", 3, $error_log);

Instructiuni DIY

Se dezactiveaza

Cod: Selectaţi tot

@define('DEBUG', true);
din config.php:

Cod: Selectaţi tot

// @define('DEBUG', true);

Mod realizat de catre Highway of Life

Download: aici

Scris: 18-Oct-2007, 19:34:39
de thecrewstyle
chiar nu stii cum sa iti mai faci reclama la forum ? :roll:

Raspuns

Scris: 18-Oct-2007, 19:43:44
de ValceaForum
Incerc sa prezint lucruri utile pentru cei care au nevoie. L-am testat si mi-a fost de folos.
Am postat unde trebuia.

De ce nu incerci si tu sa incluzi in mesaje solutii la unele probleme sau noutati legate de Phpbb3, in loc sa faci comentarii ?

Scris: 18-Oct-2007, 20:02:03
de thecrewstyle
Dap. Dar incearca sa scrii tot continutul aici ;) In toate mesajele cu moduri pe care le-ai prezentat, ai pus un link spre forumul tau unde se afla tot continutul :) Cel mai util ar fi sa postezi aici tot contentul ca doar este un forum de ajutor :)
Bafta

Raspuns

Scris: 18-Oct-2007, 20:10:11
de ValceaForum
Am editat mesajul anterior. Multumit ? :)