PHP Classes

File: logger/NmnLoggerUsageExample.php

Recommend this page to a friend!
  Classes of Ivan Preziosi   Nmn Logger   logger/NmnLoggerUsageExample.php   Download  
File: logger/NmnLoggerUsageExample.php
Role: Example script
Content type: text/plain
Description: basic usage example
Class: Nmn Logger
Message logging abstraction
Author: By
Last change: verion 0.5
Date: 18 years ago
Size: 1,793 bytes
 

Contents

Class file image Download
<?php

 
/* NMNLOGGER BASIC USAGE EXAMPLE /*
 /*
    NmnLogger is a library that provides logging functionnality to php applications
    Copyright (C) 2006 Ivan Preziosi from netmeans.net - Rome.

    This library is free software; you can redistribute it and/or
    modify it under the terms of the GNU Lesser General Public
    License as published by the Free Software Foundation; either
    version 2.1 of the License, or (at your option) any later version.

    This library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
    Lesser General Public License for more details.

    You should have received a copy of the GNU Lesser General Public
    License along with this library; if not, write to the Free Software
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA

    For more informations or to join the development of the library contact
    the author at: ivan@netmeans.net
    */


    //First of all put the folder containing the logger folder in the include_path
   
set_include_path('../'.PATH_SEPARATOR); // './' should stands for for the actual folder, replace it with your actual classes or inc folder for example

    //Second include the NmnLogger.php file which contains the static methods to use the logger in it's simplyfied manner
   
require_once 'logger/NmnLogger.php';

   
//Third fire the logging with it's static method:
   
NmnLogger::logString("Hello log!");
   
//it will log onscreen and on a file placed in the fileLogs folder.
    //for logging to email you have to complete the nmn-logger-config.xml file properties.

    // Thats it! happy logging!




?>