Truncate long input and output body in AI logs
>>> [!note] Migrated issue
<!-- Drupal.org comment -->
<!-- Migrated from issue #3556125. -->
Reported by: [murz](https://www.drupal.org/user/157092)
Related to !1468
>>>
<h3 id="summary-problem-motivation">Problem/Motivation</h3>
<p>Providing the content of the AI requests input and output data is very useful, but for some requests, it can be huge, so storing the full body will increase the overall log storage size. </p>
<h3 id="summary-proposed-resolution">Proposed resolution</h3>
<p>Usually, only the starting text is meaningful in logs, not the whole text. And for binary input/output, the content is usually not needed, so we can exclude it from logging, and store, for example, only the total size of the content, instead.</p>
<p>To resolve this, would be great to add the configuration of the max length of the input and output body in logs and truncate longer data. And, maybe, an option to log only text-based input-output, and for non-text-based - log the content length instead.</p>
> Related issue: [Issue #3533109](https://www.drupal.org/node/3533109)
issue