phpDocumentor log
[ class tree: log ] [ index: log ] [ all elements ]

Class: WindLogger

Source Location: /log/WindLogger.php

Class WindLogger

Class Overview

日志记录

日志记录的级别有以下几种:

  • WindLogger::LEVEL_INFO = 1: 信息记录,只记录需要记录的信息。
  • WindLogger::LEVEL_TRACE = 2: 信息记录,同时记录来自trace的信息。
  • WindLogger::LEVEL_DEBUG = 3: 信息记录,同时记录来自trace的信息。
  • WindLogger::LEVEL_ERROR = 4: 记录错误信息,不包含trace信息。
  • WindLogger::LEVEL_PROFILE = 5: 分析信息记录,包含详细的时间及内存使用情况等
日志的存放形式也可以通过write_type设置:
  • 0: 打印全部日志信息结果
  • 1: 按照level分文件存储日志记录
  • 2: 按照type分文件存储日志记录

Located in /log/WindLogger.php [line 26]

WindModule
   |
   --WindLogger
Author(s): Information Tags:
Version:  $Id: WindLogger.php 2973 2011-10-15 19:22:48Z yishuo $
Copyright:  ©2003-2103 phpwind.com
License:  http://www.windframework.com

Methods

[ Top ]
Inherited Properties, Constants, and Methods
Inherited Properties Inherited Methods Inherited Constants

Inherited From WindModule

WindModule::$_config
WindModule::$_proxy
WindModule::$_typeValidation

Inherited From WindModule

WindModule::getConfig()
根据配置名取得相应的配置
WindModule::getRequest()
返回当前应用的WindHttpRequest对象
WindModule::getResponse()
返回当前应用的WindHttpResponse对象
WindModule::getSystemFactory()
返回当前应用的WindFactory对象
WindModule::setConfig()
设置类配置
WindModule::setDelayAttributes()
设置延迟加载类属性相关组件配置信息
WindModule::toArray()
返回该对象的数组类型
WindModule::writeTableCloneProperty()
类对象clone白名单
WindModule::__call()
重载了魔术方法__call
WindModule::__clone()
重载魔术方法__clone
WindModule::__get()
重载了魔术方法__get
WindModule::__set()
重载了魔术方法__set

[ Top ]
Constant Summary
LEVEL_DEBUG   级别3:标志该信息是一个debug
LEVEL_ERROR   级别4:记录错误信息,不包含trace信息
LEVEL_INFO   级别1: 只是记录信息不记录trace信息
LEVEL_PROFILE   级别5:分析信息记录,包含详细的时间及内存使用情况等
LEVEL_TRACE   级别2:将会打印出堆栈中trace信息
TOKEN_BEGIN   日志记录中profile信息开始的标志
TOKEN_END   日志记录中profile信息结束的标志
WRITE_TYPE   日志的方式

[ Top ]
Method Summary
void   __construct()   构造函数
void   debug()   添加debug级别的日志信息
void   error()   添加error级别的日志信息
boolean   flush()   将记录的日志列表信息写入文件
int   getMemoryUsage()   返回内存使用量
void   info()   添加info级别的日志信息
void   log()   添加info级别的日志信息
void   profileBegin()   添加profile级别的开始位置日志信息
void   profileEnd()   添加profile级别的结束位置日志信息
void   setLogDir()   设置日志保存的路径
void   setMaxFileSize()   设置日志文件最大的大小
void   trace()   添加trace级别的日志信息

[ Top ]
Methods
Constructor __construct  [line 153]

  void __construct( [string $logDir = ''], [int $writeType = 0]  )

构造函数

Parameters:
string   $logDir:  日志文件存放的目录
int   $writeType:  日志文件的保存方式

API Tags:
Access:  public


[ Top ]
debug  [line 190]

  void debug( string $msg, [string $type = 'wind.system'], [boolean $flush = false]  )

添加debug级别的日志信息

Parameters:
string   $msg:  日志信息
string   $type:  日志的类型,默认为wind.system
boolean   $flush:  是否将日志输出到文件,为true的时候将写入文件,默认为false

API Tags:
Access:  public


[ Top ]
error  [line 202]

  void error( string $msg, [string $type = 'wind.core'], [boolean $flush = false]  )

添加error级别的日志信息

Parameters:
string   $msg:  日志信息
string   $type:  日志的类型,默认为wind.core
boolean   $flush:  是否将日志输出到文件,为true的时候将写入文件,默认为false

API Tags:
Access:  public


[ Top ]
flush  [line 266]

  boolean flush( )

将记录的日志列表信息写入文件


API Tags:
Access:  public


[ Top ]
getMemoryUsage  [line 304]

  int getMemoryUsage( [boolean $peak = true]  )

返回内存使用量

Parameters:
boolean   $peak:  是否是内存峰值,默认为true

API Tags:
Access:  public


[ Top ]
info  [line 166]

  void info( string $msg, [string $type = 'wind.system'], [boolean $flush = false]  )

添加info级别的日志信息

Parameters:
string   $msg:  日志信息
string   $type:  日志的类型,默认为wind.system
boolean   $flush:  是否将日志输出到文件,为true的时候将写入文件,默认为false

API Tags:
Access:  public


[ Top ]
log  [line 243]

  void log( string $msg, [int $level = self::LEVEL_INFO], [string $type = 'wind.system'], [boolean $flush = false]  )

添加info级别的日志信息

Parameters:
string   $msg:  日志信息
int   $level:  日志记录的级别,默认为INFO级别即为1
string   $type:  日志的类型,默认为wind.system
boolean   $flush:  是否将日志输出到文件,为true则将会写入文件,默认为false

API Tags:
Access:  public


[ Top ]
profileBegin  [line 216]

  void profileBegin( string $msg, [string $type = 'wind.core'], [boolean $flush = false]  )

添加profile级别的开始位置日志信息

通过该接口添加的日志信息将是记录一个开始位置的信息

Parameters:
string   $msg:  日志信息
string   $type:  日志的类型,默认为wind.core
boolean   $flush:  是否将日志输出到文件,为true的时候将写入文件,默认为false

API Tags:
Access:  public


[ Top ]
profileEnd  [line 230]

  void profileEnd( string $msg, [string $type = 'wind.core'], [boolean $flush = false]  )

添加profile级别的结束位置日志信息

通过该接口添加的日志信息将是记录一个结束位置的信息

Parameters:
string   $msg:  日志信息
string   $type:  日志的类型,默认为wind.core
boolean   $flush:  是否将日志输出到文件,为true的时候将写入文件,默认为false

API Tags:
Access:  public


[ Top ]
setLogDir  [line 525]

  void setLogDir( $logDir, string $logFile  )

设置日志保存的路径

Parameters:
string   $logFile:  日志保存的路径
   $logDir: 

API Tags:
Access:  public


[ Top ]
setMaxFileSize  [line 536]

  void setMaxFileSize( $maxFileSize, int $_maxFileSize  )

设置日志文件最大的大小

Parameters:
int   $_maxFileSize:  文件的最大值
   $maxFileSize: 

API Tags:
Access:  public


[ Top ]
trace  [line 178]

  void trace( string $msg, [string $type = 'wind.system'], [boolean $flush = false]  )

添加trace级别的日志信息

Parameters:
string   $msg:  日志信息
string   $type:  日志的类型,默认为wind.system
boolean   $flush:  是否将日志输出到文件,为true的时候将写入文件,默认为false

API Tags:
Access:  public


[ Top ]
Constants
LEVEL_DEBUG = 3 [line 49]

级别3:标志该信息是一个debug

debug信息将会导出trace信息和debug详细信息


[ Top ]
LEVEL_ERROR = 4 [line 56]

级别4:记录错误信息,不包含trace信息


[ Top ]
LEVEL_INFO = 1 [line 33]

级别1: 只是记录信息不记录trace信息


[ Top ]
LEVEL_PROFILE = 5 [line 63]

级别5:分析信息记录,包含详细的时间及内存使用情况等


[ Top ]
LEVEL_TRACE = 2 [line 40]

级别2:将会打印出堆栈中trace信息


[ Top ]
TOKEN_BEGIN = 'begin:' [line 77]

日志记录中profile信息开始的标志


[ Top ]
TOKEN_END = 'end:' [line 84]

日志记录中profile信息结束的标志


[ Top ]
WRITE_TYPE = 2 [line 70]

日志的方式


[ Top ]

Documentation generated on Fri, 30 Mar 2012 11:43:36 +0800 by phpDocumentor 1.4.4