autoship_after_log_entry

(src/logger.php) Within the autoship_log_entry() function and allows devs to perform various actions after log entries are created. For example, this would allow merchants to fire an email to notify themselves when an issue comes up.

Example

 
...
// Open / Create the Log File
  $log_file = fopen( $path . $logfilename, 'a');

  if ( !$log_file ) {
    error_log( sprintf( 'Autoship Logger Exception: Failed to create or open the log file %s.', $logfilename ) );
    return false;
  }

  fwrite( $log_file, $entry . "\n" );
  fclose( $log_file );

  // Allow for email and other actions after a log entry has been added.
  do_action( 'autoship_after_log_entry', $time, $entry, $context, $message );

  return true;

}

Still need help? Contact Us Contact Us