The WorkingMemoryFileLogger creates a list of relevant events (you can use 
filters to define which events are relevant for you) and just stores that as 
XML in the specified file.  This log file is not intended to be used directly 
(as it is indeed very complex).  The easiest way to see the content of the file 
in a user-friendly manner is to use the eclipse IDE and use the audit view to 
open the file.  This view will then parse the content of the file and show it 
in a tree-like structure.

If you would like to personally define how events are written out to a log 
file, you can always extend the abstract WorkingMemoryLogger and define how 
events should be written out in the logEventCreated(LogEvent) method.

Any contributions to making auditing more configurable are greatly appreciated 
! ;)

Kris

  ----- Original Message ----- 
  From: nicolae oana 
  To: Rules Users List 
  Sent: Monday, May 07, 2007 6:56 PM
  Subject: Re: [rules-users] Help needed in using working memory logger !


  Dear Kris,

  I try to create a filter for my logger, in order to obtain some simple output 
(e.g. list modified objects), but the output is still very complex :( . I think 
that I did something wrong.

  Here is the code:

  final WorkingMemoryFileLogger logger = new WorkingMemoryFileLogger( 
workingMemory );
  logger.setFileName( "log/testRules" );
  ILogEventFilter filter = new ILogEventFilter(){
               
               public boolean acceptEvent(LogEvent event){
                   
                  if(event.getType()== LogEvent.OBJECT_MODIFIED)
                     {
                      logger.logEventCreated(event);    
                      
                      return true;                    
                      }
                     return false;
               }
           };      

  logger.addFilter(filter);
  logger.writeToDisk();
         
  With kind regards,
                            Oana     


  Kris Verlaenen <[EMAIL PROTECTED]> wrote:
    You just need to create a class that implements this interface and that 
determines which events should be logged (see the javadoc of the filter and the 
working memory logger).  See ActivationLogEventFilter and 
WorkingMemoryLogEventFilter for an example.  You can add your filter to the 
logger using the addFilter(ILogEventFilter) method.

    Kris

      ----- Original Message ----- 
      From: nicolae oana 
      To: Rules Users List 
      Sent: Monday, May 07, 2007 3:22 PM
      Subject: [rules-users] Help needed in using working memory logger !



      Hi everybody,

      I try to define an ILogEventFilter on the working memory logger, but I 
didn't find anything about how to do this, on the available documentation.

      Please help me with some information about the Logger and its 
functionality!

      With kind regards, 
                     Oana







--------------------------------------------------------------------------
      Ahhh...imagining that irresistible "new car" smell?
      Check out new cars at Yahoo! Autos. 

--------------------------------------------------------------------------

      _______________________________________________
      rules-users mailing list
      rules-users@lists.jboss.org
      https://lists.jboss.org/mailman/listinfo/rules-users

    _______________________________________________
    rules-users mailing list
    rules-users@lists.jboss.org
    https://lists.jboss.org/mailman/listinfo/rules-users





------------------------------------------------------------------------------
  Ahhh...imagining that irresistible "new car" smell?
  Check out new cars at Yahoo! Autos. 


------------------------------------------------------------------------------


  _______________________________________________
  rules-users mailing list
  rules-users@lists.jboss.org
  https://lists.jboss.org/mailman/listinfo/rules-users
_______________________________________________
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users

Reply via email to