atk14/logger

ATK14 Logger 为 ATK14 框架提供日志基础设施

v0.2.1 2024-05-15 10:48 UTC

This package is auto-updated.

Last update: 2024-09-15 11:32:53 UTC


README

ATK14 Logger 为 ATK14 框架提供日志基础设施。

基本用法

define("LOGGER_DEFAULT_LOG_FILE","/path/to/app/log/log");
define("LOGGER_DEFAULT_NOTIFY_EMAIL","webmaster@example.com");

$logger = new Logger("import_articles");

// do something

$logger->info("Total articles to import ".sizeof($articles));

// in order to write buffered messages to a file, just call flush() method
$logger->flush();

// a the end of a script call flushAll();
$logger->flushAll();

消息重要级别

$logger->debug("some debug information");
$logger->info("a message");
$logger->warn("a warning");
$logger->error("error message");
$logger->security("a security message");