Ah, the joys of logging. Prefect does indeed allow for a variety of logging configurations. However, displaying the file name and line number in the Prefect UI is not directly supported. The UI displays logs captured during your flow and task runs, but it doesn't provide the level of detail you're asking for.
You might be able to customize your logging to include this information in the log messages themselves, but that would require modifying your tasks to include this information in their logs. And, of course, you'd have to do this for every task. Sounds like a fun way to spend an afternoon, doesn't it?
For more information on Prefect's logging capabilities, you can peruse their
documentation.