What is meta? ×
Meta Stack Exchange is where users like you discuss bugs, features, and support issues that affect the software powering all 134 Stack Exchange communities.

Hello, I tried to post this XML in SO for this question

But it hides half the XML. Please take a look at this post (if you have edit capabilities) and you will see a lot more XML than what gets shown.

====== start xml ======

  <!-- Rollover at midnight each day -->
  <param name="DatePattern" value="'.'yyyy-MM-dd"/>

  <layout class="org.apache.log4j.PatternLayout">
     <!-- The default pattern: Date Priority [Category] Message\n -->
     <param name="ConversionPattern" value="%d %-5p [%c] %m%n"/>

  </layout>

 <layout class="org.apache.log4j.PatternLayout">
   <param name="ConversionPattern" value="%d %-5p [%c] %m%n"/>
 </layout>     

====== end xml =====

share|improve this question

1 Answer 1

up vote 4 down vote accepted

Two issues. One, code block needs an extra blank line before it in the post body before it renders properly. The other issue is that you only have 3 spaces in front of the appenders and some of the comments. You need 4. This causes those to be treated like normal text, which then causes the following lines to get stripped along with them since they don't have the blank line preceding them.

Below is how it should probably properly look, disregarding the actual proper whitespace.


====== start xml ======

<!-- A time/date based rolling appender -->
<appender name="FILE" class="org.jboss.logging.appender.DailyRollingFileAppender">
   <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
   <param name="File" value="${jboss.server.log.dir}/server.log"/>
   <param name="Append" value="false"/>

   <!-- Rollover at midnight each day -->
   <param name="DatePattern" value="'.'yyyy-MM-dd"/>

   <layout class="org.apache.log4j.PatternLayout">
      <!-- The default pattern: Date Priority [Category] Message\n -->
      <param name="ConversionPattern" value="%d %-5p [%c] %m%n"/>

   </layout>
</appender>

<!-- A size based file rolling appender -->
<appender name="FILE" class="org.jboss.logging.appender.RollingFileAppender">
 <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
 <param name="File" value="${jboss.server.log.dir}/server.log"/>
 <param name="Append" value="false"/>
 <param name="MaxFileSize" value="10MB"/>
 <param name="MaxBackupIndex" value="20"/>

 <layout class="org.apache.log4j.PatternLayout">
   <param name="ConversionPattern" value="%d %-5p [%c] %m%n"/>
 </layout>     
</appender>

====== end xml =====

share|improve this answer
    
That was it, I thought I tabbed everything at 4. –  user146551 Apr 28 '11 at 13:39

You must log in to answer this question.