Martialdelastic / google-api-adwords-php

Automatically exported from code.google.com/p/google-api-adwords-php
Apache License 2.0
0 stars 0 forks source link

Logger's recording multiple times if the call is in the loop #9

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1.For example if your $targetingIdeaService->get($selector) in loop for 
checking more 
than one keywords, the logger records 1 time for first keyword, 2 times for 
second 
keyword, 3 times for third keyword and goes on...
2.
3.

What is the expected output? What do you see instead?
Logger should record one time. I was worried about sending because of the loop 
structure 
but I found that the request id are same. So it's just the logger writes it 
more than 
once.

What version of the product are you using? On what operating system?

Please provide any additional information below.
See attached file.

Original issue reported on code.google.com by hikmetca...@gmail.com on 17 Dec 2009 at 10:04

Attachments:

GoogleCodeExporter commented 8 years ago
The cause of this behavior is that you are calling $user->LogDefaults() 
multiple 
times, and the current logic adds new log file appenders each time.  In general 
you 
should be creating your AdWordsUser ans services only once, not inside your 
method.  
I'll work on a fix that prevents these duplicates however.

Original comment by api.ekol...@gmail.com on 19 Jan 2010 at 9:25

GoogleCodeExporter commented 8 years ago
Thanks for the solution. I still understand how I'm calling the 
$user->LogDefaults().
It calls it for each keyword which is correct but don't see where it calls for 
multiple times for one single keyword.

Let's say if you are checking 5 keywords it will record :
1 times for 1st keyword
2 times for 2nd keyword
3 times for 3rd keyword
4 times for 4th keyword
and 5 times for 5th keyword. So it records total of 15 records for only 5 
keywords.

Thanks again,
Can

Original comment by hikmetca...@gmail.com on 19 Jan 2010 at 9:32

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
So for each keyword your program called $user->LogDefaults(), which added an 
appender 
to the logging mechanism.  The logic to check for duplicate appenders wasn't 
working 
correctly, so the number of appenders grew over time.  So for the first keyword 
there 
was one appender, so it was logged once.  For the second keyword there were now 
two 
appenders total, so it was logged twice, etc.

Original comment by api.ekol...@gmail.com on 20 Jan 2010 at 4:08

GoogleCodeExporter commented 8 years ago
This was fixed in version 1.2.2.

Original comment by api.ekol...@gmail.com on 20 Jan 2010 at 4:25

GoogleCodeExporter commented 8 years ago
Thanks.

Original comment by hikmetca...@gmail.com on 20 Jan 2010 at 4:27