Shiao wrote:
> Maybe my question wasn't very clear. What I meant is that these four
> lines lead in my case to two entries per logged event:
>
> applog = logging.getLogger()
> applog.setLevel(logging.DEBUG)
> hdl = logging.FileHandler('/tmp/foo.log')
> applog.addHandler(hdl)
>
> However if I REP
Maybe my question wasn't very clear. What I meant is that these four
lines lead in my case to two entries per logged event:
applog = logging.getLogger()
applog.setLevel(logging.DEBUG)
hdl = logging.FileHandler('/tmp/foo.log')
applog.addHandler(hdl)
However if I REPLACE the above by:
logging.basi
Shiao wrote:
>> You need to remove the handler from the logging object
>>
>> # remove the handler once you are done
>> applog.removeHandler(hdl)
> I'm not sure how this could help.
If you have multiple handlers you'll get a logged message for every handler.
In your code logging.basicConfig() im
>
> You need to remove the handler from the logging object
>
> # remove the handler once you are done
> applog.removeHandler(hdl)
>
> Cheers,
> amit.
>
I'm not sure how this could help.
--
http://mail.python.org/mailman/listinfo/python-list
On 8/21/07, Shiao <[EMAIL PROTECTED]> wrote:
> Hi,
> I am getting duplicate log entries with the logging module.
>
> The following behaves as expected, leading to one log entry for each
> logged event:
>
> logging.basicConfig(level=logging.DEBUG, filename='/tmp/foo.log')
>
> But this results in two