3

In my component controller, i have implemented JLog but this issue that i have is that the file log isn't created in directoy /logs.

There is the code of the controller that i'am using :

class TdsmanagerControllerWebservice extends JControllerLegacy {
    public function update() {
       jimport('joomla.log.log');


        JLog::addLogger(
            array(
                'text_file' => 'com_tdsmanager.webservice.' . date('Y-m-d') . 'log.php'
            ),
            JLog::ALL,
            array('com_tdsmanager')
        );

        JLog::add(
           "We are in update step", JLog::INFO, 'com_tdsmanager.webservice'
        );
    }
}

Do-you have an idea why JLog not working here ?

Thanks by advance

1
  • Could you try changing array('com_tdsmanager') to just 'com_tdsmanager'
    – Lodder
    Commented Sep 24, 2015 at 11:51

1 Answer 1

3

It seems that the third parameter of JLog::add() is wrong. This parameter is a category and you have set it to 'com_tdsmanager' in JLog::addLogger(). So you should use the same in JLog::add():

JLog::add("We are in update step", JLog::INFO, 'com_tdsmanager');

See the doc https://docs.joomla.org/Using_JLog

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.