Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Phalcon\Logger\Adapter::setLogLevel() not working properly #1716

Closed
sarancea opened this issue Dec 20, 2013 · 3 comments
Closed

Phalcon\Logger\Adapter::setLogLevel() not working properly #1716

sarancea opened this issue Dec 20, 2013 · 3 comments

Comments

@sarancea
Copy link

Dears,

I'm trying to set the log level based on environment application is running on, and that is not possible.
In my log file I always have all logged messages.

I.e.

    /**
     * Init access logger adapter
     */
    $this->_logger = new LoggerAdapter(realpath($this->config->application->logDir) . '/api/' .
        $this->dispatcher->getControllerName() . '/' . $this->dispatcher->getActionName() . '/access.log');

    /**
     * Set log level retrieved from config
     */
    $this->_logger->setLogLevel(Logger::CRITICAL);

    //Start logging transaction
    $this->_logger->begin();

    $this->_logger->log('message', Logger::INFO);

    $this->_logger->commit();

Logger::CRITICAL = 1
Logger::INFO = 6

Comment to 1.2.4 phalcon setLogLevel method

            /**
     * Filters the logs sent to the handlers that are less or equal than a specific level
     *
     * @param int $level
     * @return \Phalcon\Logger\Adapter
     */

I can see the message in log file, but shouldn't, because 6 is higher then 1.

Correct me if I'm wrong.

Thanks in advance,

Best Regards,
Alex

@ghost
Copy link

ghost commented Dec 20, 2013

As far as I can see, transactions do not honor log level :-(

@ghost
Copy link

ghost commented Dec 20, 2013

Fixed in both 1.2.5 and 1.3.0, could you please check?

@phalcon
Copy link
Collaborator

phalcon commented Dec 27, 2013

Fixed in 1.2.5 and 1.3.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants