Documentation

內容目录

上一个主题

< Abstract class Phalcon\Logger\Adapter

下一个主题

Class Phalcon\Logger\Adapter\Firephp >

本页

Class Phalcon\Logger\Adapter\File

extends abstract class Phalcon\Logger\Adapter

implements Phalcon\Logger\AdapterInterface

Source on GitHub

Adapter to store logs in plain text files

<?php

$logger = new \Phalcon\Logger\Adapter\File("app/logs/test.log");
$logger->log("This is a message");
$logger->log("This is an error", \Phalcon\Logger::ERROR);
$logger->error("This is another error");
$logger->close();

Methods

public getPath ()

File Path

public __construct (string $name, [array $options])

Phalcon\Logger\Adapter\File constructor

public getFormatter ()

Returns the internal formatter

public logInternal (unknown $message, unknown $type, unknown $time, array $context)

Writes the log to the file itself

public close ()

Closes the logger

public __wakeup ()

Opens the internal file handler after unserialization

public setLogLevel (unknown $level) inherited from Phalcon\Logger\Adapter

Filters the logs sent to the handlers that are less or equal than a specific level

public getLogLevel () inherited from Phalcon\Logger\Adapter

Returns the current log level

public setFormatter (Phalcon\Logger\FormatterInterface $formatter) inherited from Phalcon\Logger\Adapter

Sets the message formatter

public begin () inherited from Phalcon\Logger\Adapter

Starts a transaction

public commit () inherited from Phalcon\Logger\Adapter

Commits the internal transaction

public rollback () inherited from Phalcon\Logger\Adapter

Rollbacks the internal transaction

public isTransaction () inherited from Phalcon\Logger\Adapter

Returns the whether the logger is currently in an active transaction or not

public critical (unknown $message, [array $context]) inherited from Phalcon\Logger\Adapter

Sends/Writes a critical message to the log

public emergency (unknown $message, [array $context]) inherited from Phalcon\Logger\Adapter

Sends/Writes an emergency message to the log

public debug (unknown $message, [array $context]) inherited from Phalcon\Logger\Adapter

Sends/Writes a debug message to the log

public error (unknown $message, [array $context]) inherited from Phalcon\Logger\Adapter

Sends/Writes an error message to the log

public info (unknown $message, [array $context]) inherited from Phalcon\Logger\Adapter

Sends/Writes an info message to the log

public notice (unknown $message, [array $context]) inherited from Phalcon\Logger\Adapter

Sends/Writes a notice message to the log

public warning (unknown $message, [array $context]) inherited from Phalcon\Logger\Adapter

Sends/Writes a warning message to the log

public alert (unknown $message, [array $context]) inherited from Phalcon\Logger\Adapter

Sends/Writes an alert message to the log

public log (unknown $type, [unknown $message], [array $context]) inherited from Phalcon\Logger\Adapter

Logs messages to the internal logger. Appends logs to the logger

Follow along: