Coder Social home page Coder Social logo

logclass's Introduction

#PHP Logger

Description:

Logging type: user can choose to log messages in file or database or both.

User can set logging type to DB or File or FileAndDB to get desired logging.

Customization: User defined

  1. filename
  2. path location
  3. database credentials
and many other parameters.
Many setter functions have been written to set many private variables.
*set_location, set_type, set_level, set_db_credentails, set_file_name, set_concatenator, set_end_of_entry, set_retry_interval, set_retry_count*
"set" function is written to set any configuration variable. Refer to function’s signature to identify which parameter should be passed to set which parameter.

Omitting logs: functionality to omit logs, depending on their severity. You can set you global logging level through “set_level” function. Enumeration has been defined for logging level.

  • const Error = 4;
  • const Warning = 3;
  • const Debug = 2;
  • const Info = 1;

Value from above enumeration must be passed in “write” method. Refer to sample example(logging_tester.php). All messages passed with logging level greater than global logging level will be printed. You can set global logging level to high or low to include and exclude logs. You can define your own logging levels as much you want and set global logging level accordingly.

Retry mechanism: When script is going to write on the file, if file is used by another process or for some reason script was unable to write on the file, script has functionality to retry again after specified interval up to specified retry-counts.
Retry interval and retry count are by default 10, defined in class constructor. You can set according to your need with set_retry_interval, set_retry_count setter functions.

logclass's People

Contributors

polymatx avatar

Stargazers

 avatar Arash Shams avatar Mahmoud Masih Tehrani avatar

Watchers

James Cloos avatar  avatar

Forkers

imendabaparsian

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.