2

I have a plugin called EducatorEntriesPlugin, and in the controller of the plugin, I have a method called actionExportEducator. In this method, I am logging an error using the code below, but when the action is called, the error is not logged into the log file, why might this be?

Craft::log("There was an error")

I also did EducatorEntriesPlugin::log, that doesn't do anything either.

7

Turn devMode on https://craftcms.com/support/dev-mode

If you want the errors to log regardless of devMode or not, pass in true as the third parameter, e.g.:

Craft::log("There was an error", LogLevel::Info, true);

https://straightupcraft.com/articles/how-do-i-log-errors-warnings-and-info-in-my-plugins-to-a-craft-log-file

  • 1
    I tried this and still am getting nothing in the log. In fact I haven't had anything show up in the log for nearly a month. Any other ideas on what could be causing this? – Daniel Boggs Sep 26 '16 at 18:25
  • Daniel: What have you tried? Guessing that part of your plugin isn't firing. I'm assuming you're not the original poster since it was marked as solved? You might want to try posting your code in a new topic and we'll give you some help. – RitterKnight Sep 26 '16 at 23:18
  • I have the same issue as @DanielBoggs, no matter what I do, Craft::log("test", LogLevel::Info, true); Never prints to the log. although the log is filling up with all kinds of info while running in devMode. – Tyguy7 Sep 27 '17 at 18:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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