eca icon indicating copy to clipboard operation
eca copied to clipboard

Every chat should have its own log

Open zikajk opened this issue 11 months ago • 7 comments

To upvote this issue, give it a thumbs up. See this list for the most upvoted issues.

Describe the bug When I have X chats then there is only one stderr buffer (I guess this is same for every editor/IDE).

Expected behavior Clear separation of chats inside STDERR or one STDERR per chat.

zikajk avatar Jan 03 '26 14:01 zikajk

That would be kind hard to do tho, as the error is coupled to the process, I can only think of preprending a ID or something in the logs to refer the chat but not sure it's that worth it

ericdallo avatar Jan 04 '26 16:01 ericdallo

That would be fine.

zikajk avatar Jan 04 '26 17:01 zikajk

@ericdallo Btw. what about switching to e.g. clojure.tools.logging? Would there be any drawback? The log is too noisy for me to find something in it. Then it would be more standardized and I could use various tools for it. Would be an easy and mostly mechanical task, good for clankers :-)

zikajk avatar May 03 '26 11:05 zikajk

@zikajk hum, I think so but I started eca simple with just prints to stderr and stdout with options for levels, what you think clojure.tools.logging would help that we don't have?

ericdallo avatar May 04 '26 18:05 ericdallo

@ericdallo Since Logback is already on your classpath, the path is short: drop a logback.xml config and we get:

  • file output with rotation** instead of a single stderr buffer shared across chats.
  • structured JSON (e.g. via logstash-encoder) so we can filter/slice by chat-id with jq or any log viewer.
  • per-namespace log levels.

The ECA logger API (logger/info tag msg) wouldn't even need to change — just swap the backing implementation. For chat separation specifically, I would log the chat-id as structured metadata and filter on it, rather than needing one stderr per chat.

zikajk avatar May 05 '26 07:05 zikajk

got it, but not sure how this would work since clients that get stderr output and present a buffer with those.

ericdallo avatar May 05 '26 12:05 ericdallo

That's not a problem at all, that would be just another appender. I'll give it a try.

zikajk avatar May 05 '26 13:05 zikajk