预览 Log Engine Framework 等待分享

Log Engine is PHP framework that used for the purpose of easier implementation of the logging functi

  1. 0daydown
    Log Engine is PHP framework that used for the purpose of easier implementation of the logging function in PHP scripts. Logging is possible via flat File, E-mail, MySQL, SQLite and Mongo DB.

    Basic usage

    To implement basic logging feature to your application you need to write only 4 lines of code!

    <?php
    // Load autoload class
    require_once 'AutoLoader.php';

    // Make log object
    $log = new LEF/Log();

    // Init. log engine
    $log->engine();

    // Trigger engine to write log
    $log->addLogInfo('Hello from LEF!');


    Using drivers

    Using drivers is also very easy, you need to make driver object and call it inside engine.

    <?php
    // Load autoload class
    require_once 'AutoLoader.php';

    // Make log object
    $log = new LEF/Log();

    // Make mongodb object
    $mongoDriver = new LEF/Driver/MongoDB();

    // Init. engine with mongo db driver
    $log->engine($mongoDriver->init('db_name'));

    // Trigger engine to write log
    $log->addLogNotice('Log added to db');