How to get console.log ID working with the debug module

I notice that function logs have an ID associated with each entry.

e.g.
11:30:37 AM: c114237c INFO [log message here]

When I log using the debug module the id is not there anymore.

What’s the purpose of the id c114237c ?

Hi there, @mjgs :wave:

Thanks for reaching out! Looks like this thread has been a bit quiet since you posted last week. Are you still facing this question? If so, could you provide a bit more context, such as the function log, your site name, and your function name? Thank you so much :slight_smile:

Yes it’s just a general question about how logging works. I started using the debug module so I can easily turn on and off debug logging but noticed that the log message ids that you get when using basic console.log disappear.

If these ids are per connection / session then they could be very useful in debugging a live system where there are many connections happening. So I wouldn’t want to lose that feature if at all possible.

What are those ids for? (They appear on every standard log message)

Hi there, @mjgs

Thanks for following up. What do you mean by debug module? Could you share a screenshot or and example site where you saw this?

1 Like

The debug module:

Sharing an example site doesn’t make a lot of sense in this context. It’s the server side logs where it happens. I already shared an entry earlier, here it is again:

e.g.
11:30:37 AM: c114237c INFO [log message here]

The id is c114237c in this case. What is that for? Session tracing?

Hey @mjgs,
Yup, session tracing! It’s a request id for the AWS lambda invocation (which is what Netlify Functions are under the hood). Not necessarily super useful for you, but if you run into issues with your functions, it’s a way for us to check for that id in our logs to see if we can see anything unusual.

1 Like

Cool feature, I can see it being very useful for debugging when there are multiple connections happening at once.

1 Like