1 Reply Latest reply on Sep 12, 2006 4:11 AM by jbaton

    Disabling DBLoggingService

    jbaton

      Hi all,

      I'm facing a problem with the DBLogging feature.
      It seems not to get a working jbpmcontext.

      However, I can make it without this feature, I have not found in the documentation how to disable it. I tried to comment the "<service name="logging" element but it did not work :)

      Does anybody know how to disable the dblogging feature ?

      Or should I stack a jbpmcontext even if I am not to use it in my programs.

      Also, any light about the stack under will be highly appreciated, why is a context needed ?

      Thanks


      JBaton

      [java] org.jbpm.JbpmException: instantiation of the DbLoggingService requires a current JbpmContext
       [java] at org.jbpm.logging.db.DbLoggingService.<init>(DbLoggingService.java:39)
       [java] at org.jbpm.logging.db.DbLoggingServiceFactory.openService(DbLoggingServiceFactory.java:32)
       [java] at org.jbpm.svc.Services.getService(Services.java:136)
       [java] at org.jbpm.svc.Services.getLoggingService(Services.java:169)
       [java] at org.jbpm.svc.save.SaveLogsOperation.save(SaveLogsOperation.java:39)
       [java] at org.jbpm.svc.Services.save(Services.java:156)
       [java] at org.jbpm.JbpmContext.save(JbpmContext.java:388)
       [java] at com.xxxxx.cerbere.Workflow.run(Workflow.java:508)
       [java] at java.lang.Thread.run(Thread.java:534)
      





        • 1. Re: Disabling DBLoggingService
          jbaton

          A way is to replace the DBLoggingFactory by some own 'do nothing' implementation.

          1/ Create a service

          public class NothingLoggingService implements LoggingService {
           public static Logger LOG = Logger.getLogger(NothingLoggingService.class);
          
           public void log(ProcessLog processLog) {
           LOG.debug( processLog.toString() );
           }
          
           public void close() {
           }
          }
          


          2/ Create a service

          public class NothingLoggingServiceFactory implements ServiceFactory {
           public Service openService() {
           return new NothingLoggingService();
           }
          
           public void close() {
           }
          
          }
          



          3/ Cut and paste default xml config (from jar) into jbpm.cfg.xml

          4/ Link the "logging" service, to your own implementation

          <service name="logging" factory="........."/>
          



          JBaton