TraceUtilities.Configure() does not close log file after writing – how to close?

21 views
Skip to first unread message

MS

unread,
Jul 25, 2025, 1:27:34 PM7/25/25
to Google Ads API and AdWords API Forum
I'm calling
TraceUtilities.Configure(TraceUtilities.DETAILED_REQUEST_LOGS_SOURCE, logFile, SourceLevels.All);
for logging my Google Ads API calls.

However, when calling
TraceUtilities.Configure(TraceUtilities.DETAILED_REQUEST_LOGS_SOURCE, logFile, SourceLevels.All);
a second time on the same file, a "System.IO.IOException" is thown with error message: "The process cannot access the file 'C:\\Temp\\Detailed.log' because it is being used by another process."

How do I correctly close a log file once it has been opened?

Google Ads API Forum Advisor

unread,
Jul 25, 2025, 5:29:10 PM7/25/25
to axe...@axeldahmen.de, adwor...@googlegroups.com

Hi,

Thank you for reaching out to the Google Ads API support team.

To investigate the error further, kindly provide the complete API logs (request and response logs with request-id and request header) generated at your end when using the Google Ads API. These logs will help us to analyze the error details, and we can assist you accordingly.

Kindly note that you have to enable logging if you are using a client library. You can refer to the guides for Java, .Net, PHP, Python, Ruby, or Perl to enable logging at your end. For REST interface requests, you can enable logging via the curl command by using the -i flag.

You can send the details via the Reply privately to the author option or direct private reply to this email.

Thanks,
 
Google Logo Google Ads API Team

Feedback
How was our support today?

rating1    rating2    rating3    rating4    rating5
[2025-07-25 21:28:28Z GMT] This message is in relation to case "ref:!00D1U01174p.!500Ht01swpTS:ref" (ADR-00320288)



Reply all
Reply to author
Forward
0 new messages