How can I log variables to a txt file? In Drupal 7 I use devel's  drupal_debug() or its alias dd() to log a variable to a drupal_debug.txt in the site's temp directory.

In the Drupal 8 version of devel this function has disappeared. It seems to be replaced by DevelDumperManagerInterface 
But it is not clear to me how it used.

How can I log variables to a txt file in Drupal 8?
The DevelDumperManagerInterface interface is implemented by DevelDumperManager. This class is in turn used as a service, 'devel.dumper'.

One way to use this function would be the following:

$ddumper = \Drupal::service('devel.dumper');
$ddumper-&gt;debug($variable_name);


Good luck!