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

How to use @google-cloud/logging-winston within AWS lambda? #797

Open
rr923 opened this issue Jun 9, 2023 · 1 comment
Open

How to use @google-cloud/logging-winston within AWS lambda? #797

rr923 opened this issue Jun 9, 2023 · 1 comment
Assignees
Labels
api: logging Issues related to the googleapis/nodejs-logging-winston API. priority: p3 Desirable enhancement or fix. May not be included in next release. type: question Request for information or clarification. Not an issue.

Comments

@rr923
Copy link

rr923 commented Jun 9, 2023

  • What you're trying to do
    I want to use @google-cloud/logging-winston to send logs to GCP logging within AWS lambda.

  • What code you've already tried

const gcpLoggingWinston = new LoggingWinston({
  projectId: "my_project_id",
  keyFilename: "/tmp/key.json",
  defaultCallback: (err: any) => {
    if (err) {
      console.error("gcp_logging error occured: " + err);
    }
  },
});

I saved the service account key to /tmp/key.json, since /tmp is the folder available for AWS lambda, and passed the file name to keyFilename.

  • Any error messages you're getting
    When running locally (dev environment), log works; but after being deployed, logs never received. And I haven't seen any error messages also.
    Since I have verified the file /tmp/key.json do exist, so what could be the cause of this issue?
    Is it possible to just provide the json content, instead of the file name?
    Or is there any other way to send logs to GCP logging from AWS lambda?
@rr923 rr923 added priority: p3 Desirable enhancement or fix. May not be included in next release. type: question Request for information or clarification. Not an issue. labels Jun 9, 2023
@product-auto-label product-auto-label bot added the api: logging Issues related to the googleapis/nodejs-logging-winston API. label Jun 9, 2023
@losalex losalex assigned losalex and unassigned daniel-sanche Jun 9, 2023
@losalex losalex removed their assignment Jul 3, 2023
@cindy-peng
Copy link
Contributor

Hi @rr923 , just want to follow up, are you still running into this issue?

@cindy-peng cindy-peng self-assigned this Jan 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: logging Issues related to the googleapis/nodejs-logging-winston API. priority: p3 Desirable enhancement or fix. May not be included in next release. type: question Request for information or clarification. Not an issue.
Projects
None yet
Development

No branches or pull requests

4 participants