Why is the logger being deactivated when the APDL solver is triggered?

Hi Team,
I was working with the logging module, and I've noticed that when the analysis is running, the logger disconnects. Once the solving process is complete, it automatically reconnects.
Is there any solution to handle this issue?
Comments
-
Hi @Naveen Kumar Begari Could you please provide a simple code example to demonstrate this issue?
0 -
Hello @Landon Mitchell Kanner , I have sent the script internally
0 -
- async def solve_structural_analysis():
- try:
- logger.debug("Solving Structural Analysis...")
- asyncio.to_thread(solution.Solve(True))
- logger.debug("Solved Structural Analysis...")
- except Exception as e:
- logger.error(f"An error occurred while solving the analysis: {e}")
- # Running the async function
- asyncio.run(solve_structural_analysis())
Here is the script, "The logger shows nothing during the analysis, and only starts logging again once the solution process is complete.
@James Derrick It would be very helpful for your guidance
Thanks
Naveen Kumar0 -
Please consider this script: @AKD-Scripting-Team
- async def solve_structural_analysis():
- try:
- logger.debug("Solving Structural Analysis...")
- asyncio.to_thread(solution.Solve(True))
- logger.debug("Solved Structural Analysis...")
- except Exception as e:
- logger.error(f"An error occurred while solving the analysis: {e}")
- #Running the async function
- asyncio.run(solve_structural_analysis())
0 -
@Ayush Kumar have you seen this issue before?
0 -
@Naveen Kumar Begari can you please share the import modules on the top of your script? And which Mechanical version are you working with?
0 -
Hi @Ayush Kumar ,
For above code I used below modules:from ansys.mechanical.core import App
import loggingAnd now im checking with - from ansys.mechanical.core.embedding.logger import Logger,Configuration
0