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

logHandler isn't logging anything #2153

Open
eloisetaylor5693 opened this issue Feb 15, 2024 · 0 comments
Open

logHandler isn't logging anything #2153

eloisetaylor5693 opened this issue Feb 15, 2024 · 0 comments

Comments

@eloisetaylor5693
Copy link

Expected Behavior

When specifying loghandler AND forcing errors such as invalid requests to contentful, then errors should be logged.

      logHandler: (level: string, data) => {
        console.log('CONTENTFUL LOG', { level, data });
      },

Actual Behavior

when configuring with our winston logger, no logs seen:

    this.client = createClient({
      environment: 'abc',
      space: 'abc',
      accessToken: 'abc',
      logHandler: (level: string, data) => {
        Logger.log(level, 'Contentful log', {
          type: 'contentful',
          properties: {
            space: 'PIM',
            data,
          },
        });
      },
    });

when using console.log, no logs seen:

    this.client = createClient({
      environment: 'abc',
      space: 'abc',
      accessToken: 'abc',
      logHandler: (level: string, data) => {
        console.log('CONTENTFUL LOG', { level, data });
      },
    });

Possible Solution

Steps to Reproduce

  1. Configure log handler
  2. Break a request. Eg fields.slug[match] => fields.slugskjhgjkdshgj[match]
  3. no logging

Context

If contentful is logging useful debug info, I want that in my logs too

Environment

  • Language Version: v20.10.0
  • Package Manager Version: 10.2.3
  • Browser Version:
  • Operating System: 23.3.0 Darwin Kernel Version 23.3.0: Wed Dec 20 21:30:44 PST 2023; root:xnu-10002.81.5~7/RELEASE_ARM64_T6000 arm64
  • Package Version: 10.6.5
  • Which API are you using?: Delivery
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