bpmnServer / bpmn-server

BPMN 2.0 server for Node.js , providing modeling, execution, persistence and monitoring for Workflow. along with sample UI. Intended to be developers workbench for BPMN 2.0
MIT License
186 stars 48 forks source link

Off logger #182

Closed kstan79 closed 8 months ago

kstan79 commented 8 months ago

I still cant find way to stop log as #133

seems 2nd property of init bpmnServer require ilogger, so I obtain ilogger from config setting which as below

Itried define config

{...,
  logger: function (server) {
        const logger = new Logger()        
        return logger;
      },
...}

all console disappear but i get this error logger

I wish to completely off the bpmn server log from .env, is it supported?

ralphhanna commented 8 months ago

Can you please share your project where this happens, I like to debug it for you

kstan79 commented 8 months ago

thanks! due to your previous repo seems something inside so I created another dummy repo for it here Just follow README.md to setup it at your environment.

It is dummy project for demonstration, the user service been commented due to it rely on sso/keycloak. after start nest will notice console like db server connection string, inside consist of db server, user and password

kstan79 commented 8 months ago

i finally solve initiate new illogger class and define at constrctor

class mylogger implements  ILogger{
      setOptions(){}
      clear(){}
      get(){ return [] as any[]}
      debug(){}
      warn(){}
      reportError(){}
      async save(filename:any){}
      log(){}
      error(){}
    }
    this.bpmnServer = new BPMNServer(this.workflowconfig.getConfig(), new mylogger());