<@U084APK40NS> Does livekit gives logs session Log...
# ask-ai
c
@millions-hair-24956 Does livekit gives logs session Logs ?
g
LiveKit does provide session logs, but the availability and access depend on the deployment setup. For LiveKit Cloud users, session logs can be accessed through the Analytics API, which allows you to list session details and fetch specific session information using session IDs. This API is available to LiveKit Cloud customers with a Scale plan or higher, as mentioned in the Analytics API documentation. For self-hosted deployments, logs can be configured and accessed through the server setup. You can enable detailed logging by adjusting the log level settings in your configuration. For example, in the LiveKit server, you can set the log level to
debug
to capture more detailed logs, as discussed in the LiveKit Slack channel. Would you like more details on how to configure logging for a specific deployment setup? Sources: - Analytics API documentation - LiveKit Slack channel 👍 0 button 👎 0 button 💡 Hint: Mention @runllm in the thread for followups.
c
@millions-hair-24956 async def start_azure_egress(_ctx_: JobContext): """Start RoomComposite Egress to Azure Blob Storage with logging""" _try_: # Initialize egress logger egress_logger = EgressLogger() livekit_host = os.getenv("LIVEKIT_HOST") lkapi = api.LiveKitAPI( url=livekit_host, # Ensure URL has proper protocol _api_key_=os.getenv("LIVEKIT_API_KEY"), _api_secret_=os.getenv("LIVEKIT_API_SECRET") ) # Azure Blob Storage configuration azure_config = api.AzureBlobUpload( _account_name_=os.getenv("AZURE_STORAGE_ACCOUNT"), _account_key_=os.getenv("AZURE_STORAGE_KEY"), _container_name_=os.getenv("AZURE_CONTAINER_NAME"), ) # Generate unique filename with timestamp and phone number phone_number = ctx.job.metadata.replace('+', '') if ctx.job.metadata else 'unknown' timestamp = datetime.utcnow().isoformat() filename = f"recordings/{timestamp}_{phone_number}.mp4" # Configure file output with Azure settings file_output = api.EncodedFileOutput( filepath=filename, azure=azure_config ) # Start RoomComposite Egress egress_request = api.RoomCompositeEgressRequest( _room_name_=ctx.room.name, _audio_only_=True, file=file_output ) logger.info(f"Starting egress with LiveKit host: {livekit_host}") egress_info = await lkapi.egress.start_room_composite_egress(egress_request) # Calculate call duration if available call_duration = 0 call_status = "STARTED" if hasattr(ctx, 'call_start_time'): call_duration = (datetime.utcnow() - ctx.call_start_time).total_seconds() # Log egress details to CSV await egress_logger.log_egress_info( _phone_number_=phone_number, _room_id_=ctx.room.name, _egress_info_=egress_info, _call_status_=call_status, _call_duration_=call_duration ) # Log detailed information logger.info(f""" Egress Details: - Egress ID: {egress_info.egress_id} - Room ID: {ctx.room.name} - Phone Number: {phone_number} - Recording File: {filename} - Status: {egress_info.status} - Call Duration: {call_duration:.2f}s - Call Status: {call_status} """) return egress_info async def start_azure_egress(_ctx_: JobContext): """Start RoomComposite Egress to Azure Blob Storage with logging""" _try_: # Initialize egress logger egress_logger = EgressLogger() livekit_host = os.getenv("LIVEKIT_HOST") lkapi = api.LiveKitAPI( url=livekit_host, # Ensure URL has proper protocol _api_key_=os.getenv("LIVEKIT_API_KEY"), _api_secret_=os.getenv("LIVEKIT_API_SECRET") ) # Azure Blob Storage configuration azure_config = api.AzureBlobUpload( _account_name_=os.getenv("AZURE_STORAGE_ACCOUNT"), _account_key_=os.getenv("AZURE_STORAGE_KEY"), _container_name_=os.getenv("AZURE_CONTAINER_NAME"), ) # Generate unique filename with timestamp and phone number phone_number = ctx.job.metadata.replace('+', '') if ctx.job.metadata else 'unknown' timestamp = datetime.utcnow().isoformat() filename = f"recordings/{timestamp}_{phone_number}.mp4" # Configure file output with Azure settings file_output = api.EncodedFileOutput( filepath=filename, azure=azure_config ) # Start RoomComposite Egress egress_request = api.RoomCompositeEgressRequest( _room_name_=ctx.room.name, _audio_only_=True, file=file_output ) logger.info(f"Starting egress with LiveKit host: {livekit_host}") egress_info = await lkapi.egress.start_room_composite_egress(egress_request) # Calculate call duration if available call_duration = 0 call_status = "STARTED" if hasattr(ctx, 'call_start_time'): call_duration = (datetime.utcnow() - ctx.call_start_time).total_seconds() # Log egress details to CSV await egress_logger.log_egress_info( _phone_number_=phone_number, _room_id_=ctx.room.name, _egress_info_=egress_info, _call_status_=call_status, _call_duration_=call_duration ) # Log detailed information logger.info(f""" Egress Details: - Egress ID: {egress_info.egress_id} - Room ID: {ctx.room.name} - Phone Number: {phone_number} - Recording File: {filename} - Status: {egress_info.status} - Call Duration: {call_duration:.2f}s - Call Status: {call_status} """) return egress_info except Exception as e: logger.error(f"Failed to start egress: {str(e)}") logger.error(f"Stack trace: {traceback.format_exc()}") raise Explain me _how many parameters does have egress_info have_
g
It seems likely that the
egress_info
object returned by the
start_room_composite_egress
method contains several parameters, but the exact parameters are not explicitly detailed in the provided data sources. However, based on typical API responses and the context provided,
egress_info
might include parameters such as
egress_id
,
status
, and possibly other metadata related to the egress operation. For a more precise understanding, you might want to refer to the LiveKit API documentation or the Egress API documentation to see the full structure of the
EgressInfo
object. If you need further details, I can help break down the typical structure of such API responses. Would you like more detailed information on how to access or interpret these parameters? Sources: - LiveKit API documentation - Egress API documentation 👍 0 button 👎 0 button 💡 Hint: Mention @runllm in the thread for followups.
c
@millions-hair-24956 search for EgressInfo object
g
The
EgressInfo
object is part of the LiveKit API and provides details about an egress operation. According to the LiveKit protocol documentation,
EgressInfo
is a protocol message that likely includes various fields related to the egress process. While the exact fields of
EgressInfo
are not explicitly listed in the provided data sources, it typically contains information such as the egress ID, status, and possibly other metadata like the start and end times, file details, and error information if applicable. For a complete definition, you can refer to the LiveKit protocol GitHub repository, which contains the full
EgressInfo
definition. Would you like more detailed information on specific fields within the
EgressInfo
object? Sources: - LiveKit protocol documentation 👍 0 button 👎 0 button 💡 Hint: Mention @runllm in the thread for followups.