Php-log4php)

Source: Internet
Author: User
Php-log4php (to) recently studied php log, found that log4php is very useful. Is the extended java log4j. Not much nonsense. Download the latest version (http://logging.apache.org/log4php/download.html) in the official website will src/main/php test to their own project directory to create log4php. properties configuration file, the content is as follows: log4php. appender. default = LoggerAppenderDailyFile log4php. appender. default. layout = LoggerLayoutPattern # log4php. appender. default. layout. conversionPattern = "% d {ISO8601} [% p] % c: % m (at % F line % L) % n" log4php. appender. default. layout. conversionPattern = "% d {Y-m-d H: m: s}, % m % n" log4php. app Ender. default. datePattern = Ymd log4php. appender. default. file = E:/% s. log log4php. rootLogger = INFO, default is used to create a new php Test File: The code is as follows: require_once 'php/Logger. php '; Logger: configure ('log4php. properties '); $ logger = Logger: getRootLogger (); $ logger-> info ("Hello World! 111 "); OK, log function added.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.