$log->error() method

Record an error message in the error log (errors.txt)

Note: Fatal errors should instead always throw a WireException.


// Log an error message to errors.txt log
$log->error("Login attempt failed"); 


// basic usage
$wire = $log->error(string $text);

// usage with all arguments
$wire = $log->error(string $text, $flags = 0);



Text to save in the log

flags (optional)int, bool

Specify boolean true to also display the error interactively (admin only).

Return value

Wire WireLog

$log methods and properties

API reference based on ProcessWire core version 3.0.228

Latest news

  • ProcessWire Weekly #498
    The 498th issue of ProcessWire Weekly brings in all the latest news from the ProcessWire community. Modules, sites, and more. Read on!
    Weekly.pw / 25 November 2023
  • Using date range fields in ProcessWire
    This week we'll take a detailed look at the newest addition to the ProFields set of modules: the Date Range Fieldtype and Inputfield.
    Blog / 24 November 2023
  • Subscribe to weekly ProcessWire news

“We chose ProcessWire because of its excellent architecture, modular extensibility and the internal API. The CMS offers the necessary flexibility and performance for such a complex website like superbude.de. ProcessWire offers options that are only available for larger systems, such as Drupal, and allows a much slimmer development process.” —xport communication GmbH