autogen icon indicating copy to clipboard operation
autogen copied to clipboard

[Feature Request]: Log thread ID in built-in loggers

Open ekzhu opened this issue 1 year ago • 7 comments

Is your feature request related to a problem? Please describe.

Currently the built-in loggers do not log the current thread ID. This makes it difficult to differentiate between logs from different threads.

will there be a way to differentiate between the different threads chat completions? Id need to be able to query the sqlite db for all chat completions of a single thread by @Nathan-Intergral

Describe the solution you'd like

In SQLiteLogger and FileLogger (#2596), add thread ID to each logged event. Obtain thread ID through:

import threading
current_thread_id = threading.get_native_id()
print(f"Current thread ID (native): {current_thread_id}")

Additional context

#2617

ekzhu avatar May 10 '24 22:05 ekzhu

This is merged, can we close this ticket.

jtoy avatar May 20 '24 18:05 jtoy

it is not yet in the SQLIteLogger.

ekzhu avatar May 21 '24 23:05 ekzhu

If I understand correctly, this threadId logging functionality is available in the FileLogger but not the SQLiteLogger. Is that right, @ekzhu ?

lucaswh avatar Aug 21 '24 18:08 lucaswh

If I understand correctly, this threadId logging functionality is available in the FileLogger but not the SQLiteLogger. Is that right, @ekzhu ?

Yes

ekzhu avatar Aug 27 '24 01:08 ekzhu

Hi, i have had to work on other projects for a while but i am back working with autogen again. Was this ever progressed?

Nathan-Intergral avatar Oct 02 '24 20:10 Nathan-Intergral

@Nathan-Intergral It is available now in the FileLogger autogen-agentchat~=0.2 but not in the SqliteLogger.

ekzhu avatar Oct 03 '24 23:10 ekzhu

thanks for the update, i rely on the sqllitelogger in order for me to pull out the details for a custom conversation history gui ive created so ill have to wait for the sqllitelogger to get this enhancement

Nathan-Intergral avatar Oct 04 '24 18:10 Nathan-Intergral

Closing this as team is focusing on v0.4 release for new features.

You are welcome to open a new feature request issue for the new logger handlers -- currently SQLite log handler is not supported. We can discuss whether this should be included in the core library, as an extension module, or a community package.

ekzhu avatar Oct 13 '24 06:10 ekzhu