white-author-3978501/13/2023, 3:32 PM
method, I start get a logger with
. each of these loggers gets its own configuration with an individual file. However, only one file is created and everything is written there (as if only the last of the
logger = logging.getLogger()
instances is really created. This is extremely confusing. • When using an
, I get really confusing
responses that make me suspect that a similar thing like with the logger happens here as well. Could anyone with more experience with dynamic providers give me some insights?
echoing-dinner-1953101/14/2023, 10:33 PM
white-author-3978501/16/2023, 8:52 AM
echoing-dinner-1953101/16/2023, 9:14 AM
Does that mean, I can use a dynamic resource provider to create only a single instance of a resource?No. One provider instance can handle multiple resource instances. Have you read the various docs we have on dynamic providers? Might help: https://www.pulumi.com/docs/intro/concepts/resources/dynamic-providers/ https://www.pulumi.com/blog/dynamic-providers/ https://github.com/pulumi/examples/tree/master/aws-py-dynamicresource
white-author-3978501/16/2023, 9:45 AM
echoing-dinner-1953101/16/2023, 12:27 PM
However, only one file is created and everything is written there (as if only the last of theSo if that's in the provider "create" call then it will get called multiple times (once for each instance that's created) but the behaviour for getLogger() is to always return the same root logger instance. So that's why your only seeing one file.instances is really created. This is extremely confusing.
white-author-3978501/16/2023, 4:08 PM
problems were caused by something only existing once that I thought was existing mutliple times: I initialized an ID as
as the default of a function parameter. This is a bad idea as such a code only gets executed once, when defining the function and not each time the function is called. The logging problems were caused by the fact that the
is somehow global.