3 Replies Latest reply on Sep 12, 2006 8:51 PM by c_eric_ray

    Configuring the Seam Logger to write to disk

      How do I configure a Seam injected Log class to write to disk? I've spent way too much time on this. :(

      Thanks.

        • 1. Re: Configuring the Seam Logger to write to disk
          raja05

          The @Log is only a easier way of using Apache Commons Logging. So just put a log4j.properties with your appenders configured to write to disk and drop that in the same jar file where your EJBs are present and it should work

          • 2. Re: Configuring the Seam Logger to write to disk

            Thank you.

            • 3. Re: Configuring the Seam Logger to write to disk

              An alternative is to add an appender and a category for your application like so...

               <appender name="YOUR_APP" class="org.jboss.logging.appender.DailyRollingFileAppender">
               <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
               <param name="File" value="${jboss.server.log.dir}/some_filename.log"/>
               <param name="Append" value="false"/>
              
               <!-- Rollover at midnight each day -->
               <param name="DatePattern" value="'.'yyyy-MM-dd"/>
              
               <!-- Rollover at the top of each hour
               <param name="DatePattern" value="'.'yyyy-MM-dd-HH"/>
               -->
              
               <layout class="org.apache.log4j.PatternLayout">
               <!-- The default pattern: Date Priority [Category] Message\n -->
               <param name="ConversionPattern" value="%d %-5p [%c] %m%n"/>
              
               <!-- The full pattern: Date MS Priority [Category] (Thread:NDC) Message\n
               <param name="ConversionPattern" value="%d %-5r %-5p [%c] (%t:%x) %m%n"/>
               -->
               </layout>
               </appender>
              
              
               <category name="com.yourcompany.whatever">
               <priority value="DEBUG"/>
               </category>
              


              This tells the appender to log at the DEBUG level all log calls from package level com.yourcompany.whatever.

              See this for the official word http://wiki.jboss.org/wiki/Wiki.jsp?page=SeparatingApplicationLogs