How do I set the theme logo? How can I set the logo in my custom theme in Drupal 8?

I can see that Drupal looks for the logo.svg file. I have a PNG logo.png file that I used in Drupal 7 and I would like to re-use it. I cannot set the logo as a theme setting as in Drupal 7.

Is there a way through UI or custom code in the theme to set the logo?
After Drupal 8.6.x

In your THEME.info.yml add a line like logo: logo.png. You need to clear cache for Drupal to detect this change.

Before Drupal 8.6.x

Default logo file has now become logo.svg in Drupal 8. However, to use logo.png or something else, you need to add custom settings definition in your theme. To do this, add the following lines to config/install/THEME.settings.yml file in your theme folder (replace THEME with your theme's machine name).

logo:
  path: 'themes/THEME/logo.png'
  use_default: false


After doing this, you must reinstall your theme if already installed. The file asks Drupal to install the given settings when the theme is installed. Hence, when you install the theme, the logo path parameter gets saved to the database and the default logo is disabled by the use_default parameter.