diff --git a/core/modules/file/file.module b/core/modules/file/file.module
index 6902db6..492d9e7 100644
--- a/core/modules/file/file.module
+++ b/core/modules/file/file.module
@@ -1191,7 +1191,7 @@ function file_managed_file_save_upload($element, FormStateInterface $form_state)
 
   $destination = isset($element['#upload_location']) ? $element['#upload_location'] : NULL;
   if (isset($destination) && !file_prepare_directory($destination, FILE_CREATE_DIRECTORY)) {
-    \Drupal::logger('file')->notice('The upload directory %directory for the file field %name could not be created or is not accessible. A newly uploaded file could not be saved in this directory as a consequence, and the upload was canceled.', ['%directory' => $destination, '%name' => $element['#field_name']]);
+    \Drupal::logger('file')->notice('The upload directory %directory for the @name field could not be created or is not accessible. A newly uploaded file could not be saved in this directory as a consequence, and the upload was canceled.', array('%directory' => $destination, '@name' => $element['#title']));
     $form_state->setError($element, t('The file could not be uploaded.'));
     return FALSE;
   }
diff --git a/core/modules/file/src/Tests/FileManagedFileElementTest.php b/core/modules/file/src/Tests/FileManagedFileElementTest.php
index 1ff00b9..c5b9e45 100644
--- a/core/modules/file/src/Tests/FileManagedFileElementTest.php
+++ b/core/modules/file/src/Tests/FileManagedFileElementTest.php
@@ -2,6 +2,10 @@
 
 namespace Drupal\file\Tests;
 
+use Drupal\Component\Render\FormattableMarkup;
+use Drupal\Component\Utility\Html;
+use Drupal\Component\Utility\Unicode;
+
 /**
  * Tests the 'managed_file' element type.
  *
@@ -10,6 +14,14 @@
  *   that aren't related to fields into it.
  */
 class FileManagedFileElementTest extends FileFieldTestBase {
+
+  /**
+   * Modules to enable.
+   *
+   * @var array
+   */
+  public static $modules = ['dblog'];
+
   /**
    * Tests the managed_file element type.
    */
@@ -148,6 +160,23 @@ public function testManagedFile() {
     // Check that the first file has been deleted but not the second.
     $this->assertNoFieldByXpath('//input[@name="nested[file][file_' . $fid_list[0] . '][selected]"]', NULL, 'An individual file can be deleted from a multiple file element.');
     $this->assertFieldByXpath('//input[@name="nested[file][file_' . $fid_list[1] . '][selected]"]', NULL, 'Second individual file not deleted when the first file is deleted from a multiple file element.');
+
+    // Submit file to a folder without permissions to force message fail.
+    $directory = 'public://test';
+    \Drupal::service('file_system')->chmod($directory, 0444);
+    $edit = ['files[nested_file][]' => drupal_realpath($test_file->getFileUri())];
+    $this->drupalGet($path);
+    $this->drupalPostForm(NULL, $edit, t('Upload'));
+    $this->assertRaw(t('The file could not be uploaded.'), 'Submit handler shows the error.');
+
+    // Ensure that the notice message appears in the logger page.
+    $this->drupalLogin($this->drupalCreateUser(['access administration pages', 'access site reports']));
+    $this->drupalGet('admin/reports/dblog');
+    $field_title = t('Managed <em>@type</em>', ['@type' => 'file & butter']);
+    $log_message = new FormattableMarkup('The upload directory %directory for the @name field could not be created or is not accessible. A newly uploaded file could not be saved in this directory as a consequence, and the upload was canceled.', ['%directory' => $directory, '@name' => $field_title]);
+    // The message link text is truncated to 56 characters.
+    $message_text = Unicode::truncate(Html::decodeEntities(strip_tags($log_message)), 56, TRUE, TRUE);
+    $this->assertLink($message_text, 0, 'DBLog event was recorded: [file could not be uploaded]');
   }
 
   /**
