public function showWelcomeMessage() { echo sprintf("<div class='updated'><p>The <strong>%s</strong> plugin has been installed at <em>%s</em></p></div>", $this->pluginName, $this->path); // pass logger to your class whenever you want to log something // ensure log directory has correct permissions $this->log->Info('Welcome message shown', ['action' => 'admin_notices']); }