Log

From JFramework Wiki

Jump to: navigation, search

jFramework uses a centralized log manager which is quite simple, but for a handful of reasons :

  • Simple logging without any need to set file permissions (file-based logging)
  • Changeable logging scheme if ever desired
  • Fast and flexible logging

The LogManager class which resides in '_japp/lib/log.php' handles logging features. As of now, it only include the Log member function which logs something:

Log ($Subject,$LogData,$Severity)

Subject could be any string, but is used later to categorize logs. LogData is any text you need to log and Severity defines how critical the log is. There are registered variables (in jFramework Registry) for severity, namely:

reg("jf/log/severity/debug",0); reg("jf/log/severity/info",1); reg("jf/log/severity/notice",2); reg("jf/log/severity/warning",3); reg("jf/log/severity/error",4); reg("jf/log/severity/critical",5); reg("jf/log/severity/security",6); reg("jf/log/severity/emergency",7);

Emergency and security logs are presented to the system administrator automatically. Also keep in mind that all errors and flaws in the framework itself are logged automatically. Other than the fields we provide to the logging function, It takes UserID, SessionID and Timestamp and saves them as well.

The Administration Interface provides reasonable interfaces to deal with logs. You can use numbers instead of regs. Severity is used both to categorize logs and to determine

Personal tools