def get_logs(
    *,
    project: Optional[str] = None,
    context: Optional[str] = None,
    column_context: Optional[str] = None,
    filter: Optional[str] = None,
    limit: Optional[int] = None,
    offset: int = 0,
    return_versions: Optional[bool] = None,
    group_threshold: Optional[int] = None,
    value_limit: Optional[int] = None,
    sorting: Optional[Dict[str, Any]] = None,
    group_sorting: Optional[Dict[str, Any]] = None,
    from_ids: Optional[List[int]] = None,
    exclude_ids: Optional[List[int]] = None,
    from_fields: Optional[List[str]] = None,
    exclude_fields: Optional[List[str]] = None,
    group_by: Optional[List[str]] = None,
    group_limit: Optional[int] = None,
    group_offset: Optional[int] = 0,
    group_depth: Optional[int] = None,
    nested_groups: Optional[bool] = True,
    groups_only: Optional[bool] = None,
    return_timestamps: Optional[bool] = None,
    return_ids_only: bool = False,
    api_key: Optional[str] = None,
) -> Union[List[unify.Log], Dict[str, Any]]:

source code

Returns a list of filtered logs from a project.

Arguments:

  • project - Name of the project to get logs from.
  • context - Context of the logs to get.
  • column_context - Column context of the logs to get.
  • filter - Boolean string to filter logs, for example:
  • limit - The maximum number of logs to return. Default is None (unlimited).
  • offset - The starting index of the logs to return. Default is 0.
  • return_versions - Whether to return all versions of logs.
  • group_threshold - Entries that appear in at least this many logs will be grouped together.
  • value_limit - Maximum number of characters to return for string values.
  • sorting - A dictionary specifying the sorting order for the logs by field names.
  • group_sorting - A dictionary specifying the sorting order for the groups relative to each other based on aggregated metrics.
  • from_ids - A list of log IDs to include in the results.
  • exclude_ids - A list of log IDs to exclude from the results.
  • from_fields - A list of field names to include in the results.
  • exclude_fields - A list of field names to exclude from the results.
  • group_by - A list of field names to group the logs by.
  • group_limit - The maximum number of groups to return at each level.
  • group_offset - Number of groups to skip at each level.
  • group_depth - Maximum depth of nested groups to return.
  • nested_groups - Whether to return nested groups.
  • groups_only - Whether to return only the groups.
  • return_timestamps - Whether to return the timestamps of the logs.
  • return_ids_only - Whether to return only the log ids.
  • api_key - If specified, unify API key to be used. Defaults to the value in the

Returns:

The list of logs for the project, after optionally applying filtering.