diff --git a/contrib/auto_explain/auto_explain.c b/contrib/auto_explain/auto_explain.c
new file mode 100644
index ea4f957..2f5a8f7
*** a/contrib/auto_explain/auto_explain.c
--- b/contrib/auto_explain/auto_explain.c
*************** static bool auto_explain_log_buffers = f
*** 28,33 ****
--- 28,34 ----
  static bool auto_explain_log_triggers = false;
  static bool auto_explain_log_timing = true;
  static int	auto_explain_log_format = EXPLAIN_FORMAT_TEXT;
+ static int	auto_explain_log_destination = LOG;
  static bool auto_explain_log_nested_statements = false;
  static double auto_explain_sample_rate = 1;
  
*************** static const struct config_enum_entry fo
*** 39,44 ****
--- 40,51 ----
  	{NULL, 0, false}
  };
  
+ static const struct config_enum_entry destination_options[] = {
+ 	{"log", LOG, false},
+ 	{"notice", NOTICE, false},
+ 	{NULL, 0, false}
+ };
+ 
  /* Current nesting depth of ExecutorRun calls */
  static int	nesting_level = 0;
  
*************** _PG_init(void)
*** 141,146 ****
--- 148,165 ----
  							 NULL,
  							 NULL);
  
+ 	DefineCustomEnumVariable("auto_explain.log_destination",
+ 							 "Log destination for the plan.",
+ 							 NULL,
+ 							 &auto_explain_log_destination,
+ 							 LOG,
+ 							 destination_options,
+ 							 PGC_SUSET,
+ 							 0,
+ 							 NULL,
+ 							 NULL,
+ 							 NULL);
+ 
  	DefineCustomBoolVariable("auto_explain.log_nested_statements",
  							 "Log nested statements.",
  							 NULL,
*************** explain_ExecutorEnd(QueryDesc *queryDesc
*** 353,359 ****
  			 * reported.  This isn't ideal but trying to do it here would
  			 * often result in duplication.
  			 */
! 			ereport(LOG,
  					(errmsg("duration: %.3f ms  plan:\n%s",
  							msec, es->str->data),
  					 errhidestmt(true)));
--- 372,378 ----
  			 * reported.  This isn't ideal but trying to do it here would
  			 * often result in duplication.
  			 */
! 			ereport(auto_explain_log_destination,
  					(errmsg("duration: %.3f ms  plan:\n%s",
  							msec, es->str->data),
  					 errhidestmt(true)));
diff --git a/doc/src/sgml/auto-explain.sgml b/doc/src/sgml/auto-explain.sgml
new file mode 100644
index 08b67f2..bc1b4d7
*** a/doc/src/sgml/auto-explain.sgml
--- b/doc/src/sgml/auto-explain.sgml
*************** LOAD 'auto_explain';
*** 189,194 ****
--- 189,213 ----
  
     <varlistentry>
      <term>
+      <varname>auto_explain.log_destination</varname> (<type>enum</type>)
+      <indexterm>
+       <primary><varname>auto_explain.log_destination</> configuration parameter</primary>
+      </indexterm>
+     </term>
+     <listitem>
+      <para>
+       <varname>auto_explain.log_destination</varname> selects where
+       auto_explain will log the query plan.
+       The allowed values are <literal>log</literal>, which logs the plan to the
+       server log, and <literal>notice</literal>, which logs it as a NOTICE, which
+       allows clients to access it. <literal>log</literal> is the default.
+       Only superusers can change this setting.
+      </para>
+     </listitem>
+    </varlistentry>
+ 
+    <varlistentry>
+     <term>
       <varname>auto_explain.log_nested_statements</varname> (<type>boolean</type>)
       <indexterm>
        <primary><varname>auto_explain.log_nested_statements</varname> configuration parameter</primary>
