diff --git a/event_log.module b/event_log.module
index 69dfc21..8bf1cc3 100755
--- a/event_log.module
+++ b/event_log.module
@@ -69,7 +69,7 @@ function event_log_permission() {
  *     Informative data, for example of the modified object. Optional.
  */
 function event_log_insert(&$log) {
-  if (php_sapi_name() == 'cli') {
+  if (!variable_get('event_log_enable_cli', FALSE) && drupal_is_cli() == 'cli') {
     // Ignore CLI requests.
     return;
   }

