Log file size?

Hi, I've read that the max log file size is 8k. When reaching the size limit, it then saves the file as .bak and starts a new log file. So you can always have max 16k of debug info. 

When I look at my log files, it starts a new file when the log file reaches 5,2 kbytes. Did I misunderstand something? 

Also, for me it would be really good to be able to save more debug data. But I guess that is not possible? 

best regards

Fredrik 

  • I think int 2 * 4k.

    You need to minimize the output. For example I log timestamps as HH:MM:SS usually, but in some cases that's not important in the log (the order of the lines is good enough) and removing the time makes it possible to log more lines. Also instead of using function names as prefix I sometimes use just the initials of the function name: open->o, close->c, ...

  • The current dev docs say the max is “5kb” (clearly they mean 5 KB). Ofc in the past, the forums have said 6 or 8 KB, but it seems 5 KB is the right number based on what you’ve found.

    https://developer.garmin.com/connect-iq/core-topics/debugging/ 

    A Note About Log Files

    When any log file on a device exceeds 5kb in size, it will automatically be archived to <LOGNAME>.BAK, and a new log will be started. Any old .BAKfiles will be overwritten when the archive occurs, so the max space a log can reach is around 10kb.

  • Not sure what the nature of your debug data is, but if it's something small that needs to be logged continuously over time, you could look into recording data as FIT fields. (Probably only appropriate for local debugging.)

    Also for local debugging, you could use makeWebRequest() to send data to your own local server. (Unless it's a data field on an older device, in which case you can only make network requests in the background, once every 5 minutes.)