Giter Site home page Giter Site logo

aalhibsyy / logging-module-for-php-applications Goto Github PK

View Code? Open in Web Editor NEW

This project forked from bob-utveckling/logging-module-for-php-applications

0.0 0.0 0.0 12 KB

This Module enables INSERT/UPDATE logging for PHP Applications

PHP 100.00%

logging-module-for-php-applications's Introduction

############################ Logging Module For PHP Database Applications This Module enables logging of Inserts/Updates in Database and it makes it possible to read the logged data by issuing a "show_log" command. #############################

Follow the 5 steps below to enable the Module in your application which works as a helper to log all insert/update SQL queries:

  1. Create the Logging Table in your database by running the following SQL Query:

    CREATE TABLE log_table ( id int(11) NOT NULL AUTO_INCREMENT, system_date text COLLATE utf8_bin, date text COLLATE utf8_bin, what_table text COLLATE utf8_bin, what_record text COLLATE utf8_bin, describe_action text COLLATE utf8_bin, note text COLLATE utf8_bin, IP_or_general_location_description text COLLATE utf8_bin, username text COLLATE utf8_bin, system_user_is_using text COLLATE utf8_bin, PRIMARY KEY (id) ) ENGINE=MyISAM AUTO_INCREMENT=160 DEFAULT CHARSET=utf8 COLLATE=utf8_bin

  2. Add the folder "module-logging" to the root path of your application.

  3. Insert these 5 lines of code in your main PHP Script to make logging possible:

    $log_table = "log_table";

    $show_how_many_log_entries=10;

    date_default_timezone_set('Europe/Stockholm');

    include ("./module-logging/logging.php");

    include ("./module-logging/logging-front-end.php");

  4. Whereever there is an SQL Execution code in your application add the statement:

    log_this_change_to_database($sqlStatement);

  5. In order to see an interface to the logged data, add the below two statements:

    global $show_how_many_log_entries; show_logs($show_how_many_log_entries);

Screenshot of the module showing last 5 operations:

Screenshot- Data Logging Module

logging-module-for-php-applications's People

Contributors

bob-utveckling avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.