Question on logging with winston library

Hi community :waving_hand:
I’m trying to setup winston in my Sveltekit library with the Console transports.
In the official docs here, they mention:

By default the winston.transports.Console transport sends messages to stdout and stderr . This is fine in most situations; however, there are some cases where this isn’t desirable, including:

Writing JSON format messages in AWS Lambda

What about with Vercel serverless fluid functions? Should we use the forceConsole option?

Reason for this question is that it seems like we are often missing some of our logs when looking at function execution in the Vercel dashboard.

Thanks :+1:

Hi @alexbjorlig, I have not used winston with Vercel but I believe the stdout and stderr are supported.

About missing logs: I read in docs today that only the first 256 lines or 256KB of a function execution are stored. So, your logs maybe trimmed for those reasons.

What this can’t possible be true with fluid compute and long running tasks?

256 lines is nothing?

I fixed it using this:

1 Like

That’s perfect. Thanks for sharing it here, Alex.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.