This is an automated email from the ASF dual-hosted git repository.

vy pushed a commit to branch release-2.x
in repository https://gitbox.apache.org/repos/asf/logging-log4j2.git


The following commit(s) were added to refs/heads/release-2.x by this push:
     new 512501e  LOG4J2-2977 Replace outdated PatternLayout.createLayout() 
calls in docs with createDefaultLayout().
512501e is described below

commit 512501ecfa864e29781d0e4d43c0352938d946c5
Author: Volkan Yazici <[email protected]>
AuthorDate: Wed Feb 3 15:55:19 2021 +0100

    LOG4J2-2977 Replace outdated PatternLayout.createLayout() calls in docs 
with createDefaultLayout().
---
 src/changes/changes.xml               | 3 +++
 src/site/xdoc/manual/customconfig.xml | 7 +++----
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index 89a3715..110e2c1 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -34,6 +34,9 @@
       <action issue="LOG4J2-2998" dev="vy" type="fix">
         Fix truncation of excessive strings ending with a high surrogate in 
JsonWriter.
       </action>
+      <action issue="LOG4J2-2977" dev="rgrabowski" type="fix">
+        Replace outdated PatternLayout.createLayout() calls in docs with 
createDefaultLayout().
+      </action>
       <action issue="LOG4J2-2973" dev="fricchiuti" type="fix">
         Rename EventTemplateAdditionalField#type (conflicting with properties 
file parser) to "format".
       </action>
diff --git a/src/site/xdoc/manual/customconfig.xml 
b/src/site/xdoc/manual/customconfig.xml
index e57af39..0564e39 100644
--- a/src/site/xdoc/manual/customconfig.xml
+++ b/src/site/xdoc/manual/customconfig.xml
@@ -267,8 +267,8 @@ public class MyXMLConfiguration extends XMLConfiguration {
     protected void doConfigure() {
         super.doConfigure();
         final LoggerContext ctx = (LoggerContext) LogManager.getContext(false);
-        final Layout layout = 
PatternLayout.createLayout(PatternLayout.SIMPLE_CONVERSION_PATTERN, config, 
null,
-              null,null, null);
+        final Configuration config = context.getConfiguration();
+        final Layout layout = PatternLayout.createDefaultLayout(config);
         final Appender appender = 
FileAppender.createAppender("target/test.log", "false", "false", "File", "true",
               "false", "false", "4000", layout, null, "false", null, config);
         appender.start();
@@ -305,8 +305,7 @@ public class MyXMLConfiguration extends XMLConfiguration {
             <pre class="prettyprint linenums"><![CDATA[
         final LoggerContext ctx = (LoggerContext) LogManager.getContext(false);
         final Configuration config = ctx.getConfiguration();
-        Layout layout = 
PatternLayout.createLayout(PatternLayout.SIMPLE_CONVERSION_PATTERN, config, 
null,
-            null,null, null);
+        final Layout layout = PatternLayout.createDefaultLayout(config);
         Appender appender = FileAppender.createAppender("target/test.log", 
"false", "false", "File", "true",
             "false", "false", "4000", layout, null, "false", null, config);
         appender.start();

Reply via email to