Uploaded image for project: 'JBoss Logging'
  1. JBoss Logging
  2. JBLOGGING-104

MDC Logging not appearing in server.log

    XMLWordPrintable

    Details

      Description

      Hi

      I am trying to log using org.jboss.logging.MDC but the log entry is not found in server.log

      Steps followed:

      1.Maven Dependency Used:

      <dependency>
      	<groupId>org.jboss.logging</groupId>
      	<artifactId>jboss-logging</artifactId>
      	<version>3.1.4.GA</version>
      </dependency>
      

      2.Athe below code in the controller
      org.jboss.logging.MDC.put("MDC Worked", new String("MDC Worked"));

      3.Placed the jboss-logging.xml inside META-INF folder of the web application.
      The content of jboss-logging.xml is as follows:

      <periodic-rotating-file-handler  
               file-name="${jboss.server.log.dir}/server.log"  
               name="FILE"  
               autoflush="true"  
               append="true"  
               suffix=".yyyy-MM-dd">  
        
            <error-manager>  
               <only-once/>  
            </error-manager>  
        
             <formatter>  
               <pattern-formatter pattern="%d %-5p [%c] (%t) [%X{entry1}, %X{entry2}] %s%E%n"/>  
            </formatter>  
         </periodic-rotating-file-handler> 
      

      Problem:

      There are no errors but the log entry is not found in the server.log

      Regards
      Arun

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                jamezp James Perkins
                Reporter:
                rarunrk ArunPrasath Rajmohan
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - 1 day, 4 hours
                  1d 4h
                  Remaining:
                  Remaining Estimate - 1 day, 4 hours
                  1d 4h
                  Logged:
                  Time Spent - Not Specified
                  Not Specified