# Remove execution info from workflow/activity logs in python

**URL:** <https://community.temporal.io/t/remove-execution-info-from-workflow-activity-logs-in-python/17160>\
**Category:** Community Support\
**Tags:** python-sdk, logging\
**Created:** [April 16, 2025, 11:04am UTC](https://community.temporal.io/t/remove-execution-info-from-workflow-activity-logs-in-python/17160 "2025-04-16T11:04:34Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ReyJust](https://avatars.discourse-cdn.com/v4/letter/r/b5e925/32.png) [@ReyJust](https://community.temporal.io/u/ReyJust)\
**Post date:** [April 16, 2025, 11:04am UTC](https://community.temporal.io/t/remove-execution-info-from-workflow-activity-logs-in-python/17160/1 "2025-04-16T11:04:34Z")

</div>

Hello wondering, if it’s possible to pass a parameter to remove temporal data from the logger? E.g remove `({'activity_id': '2', 'activity_type': 'print_msg', 'attempt': 1, 'namespace': 'default', 'task_queue': 'onboarding-tasks', 'workflow_id': 'test-workflow-b6c8c0dd-8b0b-440c-a4e9-9c2f194cba57', 'workflow_run_id': '416c0bca-ca53-4709-a34f-3e30170a1601', 'workflow_type': 'Test'})` .

```py
@activity.defn
async def print_msg(msg):
    activity.logger.info(f"Executing { msg }")
    activity.logger.warning(f"Executing { msg }", extra={})
    activity.logger.error(f"Executing { msg }", extra={})
    activity.logger.critical(f"Executing { msg }", extra={})

    return True

```

Gives

```auto
2025-04-16 15:00:02 - temporalio.activity - [INFO] Executing activity_b ({'activity_id': '2', 'activity_type': 'print_msg', 'attempt': 1, 'namespace': 'default', 'task_queue': 'onboarding-tasks', 'workflow_id': 'test-workflow-b6c8c0dd-8b0b-440c-a4e9-9c2f194cba57', 'workflow_run_id': '416c0bca-ca53-4709-a34f-3e30170a1601', 'workflow_type': 'Test'})
2025-04-16 15:00:02 - temporalio.activity - [WARNING] Executing activity_b ({'activity_id': '2', 'activity_type': 'print_msg', 'attempt': 1, 'namespace': 'default', 'task_queue': 'onboarding-tasks', 'workflow_id': 'test-workflow-b6c8c0dd-8b0b-440c-a4e9-9c2f194cba57', 'workflow_run_id': '416c0bca-ca53-4709-a34f-3e30170a1601', 'workflow_type': 'Test'})
2025-04-16 15:00:02 - temporalio.activity - [ERROR] Executing activity_b ({'activity_id': '2', 'activity_type': 'print_msg', 'attempt': 1, 'namespace': 'default', 'task_queue': 'onboarding-tasks', 'workflow_id': 'test-workflow-b6c8c0dd-8b0b-440c-a4e9-9c2f194cba57', 'workflow_run_id': '416c0bca-ca53-4709-a34f-3e30170a1601', 'workflow_type': 'Test'})
2025-04-16 15:00:02 - temporalio.activity - [CRITICAL] Executing activity_b ({'activity_id': '2', 'activity_type': 'print_msg', 'attempt': 1, 'namespace': 'default', 'task_queue': 'onboarding-tasks', 'workflow_id': 'test-workflow-b6c8c0dd-8b0b-440c-a4e9-9c2f194cba57', 'workflow_run_id': '416c0bca-ca53-4709-a34f-3e30170a1601', 'workflow_type': 'Test'})

```

As you can see it can become really cumbersome!  
Thanks

---

<div class="post-metadata">

**Author:** ![Chad\_Retz](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/chad_retz/32/1396_2.png) [@Chad\_Retz](https://community.temporal.io/u/Chad_Retz)\
**Post date:** [April 16, 2025, 12:38pm UTC](https://community.temporal.io/t/remove-execution-info-from-workflow-activity-logs-in-python/17160/2 "2025-04-16T12:38:24Z")

</div>

Not a per-log parameter, but `workflow.logger.workflow_info_on_message = False` and `activity.logger.activity_info_on_message = False` can be set on application startup (there are similar `on_extra` forms if you care more about the extra dict than the message). If you need per-each-log-call customization, you’ll have to have your own adapter/handler.
