#Logger inconsistencies

1 messages · Page 1 of 1 (latest)

thin surge
#

Hello everyone, I have two questions about the logger. I use it to log return values of an asynchronous batchTriggerAndWait function, but there are two erroneous behaviours: Firstly, the metadata is only logged in dev mode, and secondly, it is incomplete there. Strangely, logging stops in the middle of the object, so that the logged object is valid, but some keys are still missing.

Here is an example of the logged payload:
{ "tenants": [ { "id": "1", "name": "X", "teams": 0, "billableListings": 47 }, { "id": "2", "name": "Y", "teams": 0, "billableListings": 92 }, ..., { "id": "3", "name": "Z" } ] }

We are using trigger cloud.

dull dust
#

Ah yes, if this a really long log? We cap log payloads at a certain size

#

metadata is only logged in dev mode

Can you expand on this a bit?

thin surge
#

Hey, thanks a million for this really quick answer! Is there a way to log larger payloads? and wouldn't it be good if trigger.dev would give a hint when this limit has been reached?

thin surge
dull dust
#

There's not currently a way to log large payloads in a single log call, I guess the best workaround for now is to do it in separate logs in a loop.

How big is one of these logs? How many items are in that tenants array? Is that the only key in that object? We can probably increase the limits so it'd be helpful to know what would work for you.

We had a higher limit originally and people were logging enormous objects and it caused problems for us then. We are going to be doing to a different log store at some point and we can then increase the limits to be very high.

https://github.com/triggerdotdev/trigger.dev/issues/1276

GitHub

We limit the length of log properties but don't make it clear that this has happened. We should make this clearer somehow, e.g. by adding a property that says this? TRI-3504