Hello again, I am struggling to get logging workin...
# ask-community
f
Hello again, I am struggling to get logging working from within a task. The code I’m using is taken from the docs:
Copy code
@task
def generate_set_sublists(inspection_id):
    logger = prefect.context.get("logger")
    <http://logger.info|logger.info>("An info message.")
    logger.warning("A warning message.")
But, despite the task completing successfully, I can’t see those logs in the prefect cloud api. I do however see the ‘Starting task run…’ and ‘Finished task run for task with final state: Success’ logs that seem like the default. I am currently running my flow using the ECS Agent using Fargate. Thanks in advance.
k
Hey @Frank Oplinger, this looks right. I can’t think of any reason why this would not log if you are successful in getting other logs. Could you show me the full flow code? Is this just on ECS?
f
Yes this is on ECS. Let me see if I can get a sanitized version of the flow that I can share, thanks for your help.
@Kevin Kho this ended up being total user error on my end 🤦 logging is working just fine, apologies to waste your time.
k
No worries at all! What was the issue, just so I know?
f
Was editing one flow and executing another lol