t3rry/lbase

Base support, such as logging / http head processing for other libs

1.0 2020-02-22 22:52 UTC

This package is auto-updated.

Last update: 2024-04-23 08:43:38 UTC


README

Instructions

Default log folder is /var/log/ Default logging file name is application.log. Default log level is logging all. you may override these behavior by setting global variable / constant

  • default_log / DEFAULT_LOG
  • log_level / LOG_LEVEL
  • log_folder / LOG_FOLDER

when you need to log into a different log file, make sure you define the corresponding constant / variable.

  • %log_name%_log / %LOG_NAME%_LOG
  • LOG_TYPE_%LOG_NAME%

definition of LOG_TYPE_%LOG_NAME% should start on 4, and avoid duplicate values.

example: to log to /var/log/database.log, we should define

    define('DATABASE_LOG','database.log')
    define('LOG_TYPE_DATABASE',"LOG_TYPE_DATABASE")

to override database log location , define in global scope:

 $database_log = '/var/log/laura/database.log';

we also have the following log type predefined:

  • database
  • cron
  • access