The server caps lines at 4096 characters, but the client receives these as JSON, so when receiving there's an extra ~70 characters that make up the timestamp, service name, field names, and JSON punctuation. This means that limiting the slice size to 4096 characters there will result in buffer full errors.
Allow an extra 1024 characters for the JSON 'overhead' - this should be far more than needed, but is only used within the logs function - I wasn't able to find any maximum length for a service name, so a precise extra count is tricky. This could be lowered (I would guess 128 characters would usually be sufficient) if this might be too much memory in some Pebble use cases.
The server caps lines at 4096 characters, but the client receives these as JSON, so when receiving there's an extra ~70 characters that make up the timestamp, service name, field names, and JSON punctuation. This means that limiting the slice size to 4096 characters there will result in buffer full errors.
Allow an extra 1024 characters for the JSON 'overhead' - this should be far more than needed, but is only used within the
logs
function - I wasn't able to find any maximum length for a service name, so a precise extra count is tricky. This could be lowered (I would guess 128 characters would usually be sufficient) if this might be too much memory in some Pebble use cases.Also adds tests for the long log line cases.
Fixes #376