Skip to content

Conversation

@njhale
Copy link
Member

@njhale njhale commented Aug 19, 2024

Capture the combined log output from both client and server side and write them to the console and a log file (at ~/Library/Logs/acorn/acorn.log on MacOS).

Log files are rotated at 1 MB.

Notes:

  • This is the simpler of two approaches I'd played with, the other had more control over the log formats -- e.g. color, json output, etc -- and log rotation, but was more complex and had some issues capturing everything.
  • For logging to be an effective means to debug, we're going to want to instrument more of the business logic -- e.g. the socket server -- with debug logs. Be on the look out for a PR in the near future adding this.
  • Long term, we may want to look at setting up OTEL logging to a file for improved tracing
  • I'm going to follow this up with an error page that prints a snippet of the logs around the digest for uncaught errors and provides a "download logs" button that downloads a zip of the logs.
  • We're likely also going to want to zip up the gptscript logs/config/cache with this to get a complete picture of what's going on when a user encounters an error, but I'll hold off on that for now.

@njhale njhale force-pushed the enhance/logs branch 2 times, most recently from c2fdebc to 7cc7cea Compare August 19, 2024 15:33
Signed-off-by: Nick Hale <4175918+njhale@users.noreply.github.com>
@njhale njhale merged commit fb3b7f3 into gptscript-ai:main Aug 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants