Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom AjaxAppender does not execute if batchsize is set to one #83

Open
john-babb-tss opened this issue May 19, 2023 · 0 comments
Open

Comments

@john-babb-tss
Copy link

john-babb-tss commented May 19, 2023

I'm not sure if this is a bug or not, but it looks like the custom ajax AjaxAppender will only work if you have a batch size > 1. Can you take a look at this and let me know why this is an issue, and or, if this is a expected?

private initializeLogger() {
        this.rootlogger = this.JL('tss');
        const beforeSendExample = (xhr) => {
          xhr.setRequestHeader('X-Correlation-Id', this.correlationService.current.id);
        };
        this.ajaxAppender = JL.createAjaxAppender('ajaxAppenderTss');
        this.ajaxAppender.setOptions({
          level : JL.getAllLevel(),
          sendWithBufferLevel : JL.getErrorLevel(),
          storeInBufferLevel : -2147483648,
          bufferSize : 0, // buffering switch off by default
          batchSize : 1, // -------------------------------                      DOES NOT WORK
         // batchSize : 2, // -------------------------------                    This does work.
          maxBatchSize : 20,
          batchTimeout : 2147483647,
          sendTimeout : 5000,
          beforeSend: beforeSendExample
        });
        this.consoleAppender = JL.createConsoleAppender('consoleAppenderTss');
        this.rootlogger =  this.rootlogger.setOptions({
          level: JL.getAllLevel(),
          appenders: [this.ajaxAppender, this.consoleAppender]
        });
    }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant