Download the PHP package lishaoen/think-log without Composer

On this page you can find all versions of the php package lishaoen/think-log. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package think-log

think-log

写入LOG日志,支持文件。

安装

composer require lishaoen/think-log

用法:

$config = [
    //全局唯一标识符
    'app_guid'     => 'DX-php-0002',
    //应用名称
    'app_name'     => '昆港工单系统',
    // 日志记录方式,内置 file socket 支持扩展
    'type'         => 'File',
    // 日志保存目录
    'path'         => RUNTIME_PATH.'admin_logs',
    //日志的时间格式,默认是` c `
    'time_format'   =>'Y-m-d H:i:s',
    // 是否JSON格式记录
    'json'         => true,
    //单个日志文件的大小限制,超过后会自动记录到第二个文件
    'file_size'     =>2097152,
    //是否关闭日志写入
    'close'        => false,
    //允许日志写入的授权key
    'allow_key'    => '',
    // 日志记录级别
    'level'        => ['emergency','alert', 'critical','error','warning','notice','info','debug','sql','login','loginerror'],
    //是否单一文件日志
    'single'      => false,
    //独立记录的日志级别
    //'apart_level' => [],
    'apart_level' => ['emergency','alert', 'critical','error','warning','notice','info','debug','sql','login','loginerror'],
    //最大日志文件数(超过自动清理)
    'max_files'   => 50,
];

//初始化日志类
$log = new \lishaoen\log\Log($config);
//设置用户登录信息
$logAdmin->setCustominfo($userinfo);

//调取日志类方法记录日志
$log->record('error info','error', $context = [],$custominfo = []);
$log->error('error info', $context = [],$custominfo = []);
$log->info('log info', $context = [],$custominfo = []);
$log->save();
或
$log->record($msg='error info',$type ='error', $context = [],$custominfo = [])->save();
$log->error($msg='error info',$context = [],$custominfo = [])->save();

方法参数说明:

/**
 * @param  string $msg       日志信息
 * @param  string $type      日志级别
 * @param  array  $log_custom 日志追加自定义数组字段信息
 * @param  array  $context   替换内容
 */

All versions of think-log with dependencies

PHP Build Version
Package Version
Requires php Version >=5.4.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package lishaoen/think-log contains the following files

Loading the files please wait ...