You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
And for myself, the exact same issue - I log with agentless Datadog which is not available until DI is available.
I'm sure there are people with other startup requirements than "log on startup" but that's what I need and so that's how the rest of this issue is written.
Describe the solution you'd like
You probably know your underlying platform better than me, but I'm thinking some combination of:
A build step on IFunctionHostBuilder that builds and activates the logger first so it's available for the rest of the build - in particular, available to the builder itself if it gets any errors during the rest of the build and during DI if required services cannot be found or some other issue occurs.
a virtual method on FunctionStartup, called on app startup immediately after build before any triggers are processed
a dedicated trigger that runs on startup without the scaling problems of using a TimerTrigger set to RunOnStartup. I cannot speak to the rest of Azure's users but I want to use my logger on app startup when
I've pushed a new image
the app has been stopped and I manually start the app e.g through azure portal
That is: I want to log, only once, when I have made a change, to see if it happened as expected.
Describe alternatives you've considered
It is possible to get logging on startup using a TimerTriggerAttribute set to RunOnStartup but the guidance for that is:
Caution
Don't set runOnStartup to true in production. Using this setting makes code execute at highly unpredictable times. In certain production settings, these extra executions can result in significantly higher costs for apps hosted in a Consumption plan. For example, with runOnStartup enabled the trigger is invoked whenever your function app is scaled. Make sure you fully understand the production behavior of your functions before enabling runOnStartup in production.
What problem would the feature you're requesting solve? Please describe.
Various issues mainly related to logging:
'0 functions loaded'
) when starting the Functions Host #9515And for myself, the exact same issue - I log with agentless Datadog which is not available until DI is available.
I'm sure there are people with other startup requirements than "log on startup" but that's what I need and so that's how the rest of this issue is written.
Describe the solution you'd like
You probably know your underlying platform better than me, but I'm thinking some combination of:
IFunctionHostBuilder
that builds and activates the logger first so it's available for the rest of the build - in particular, available to the builder itself if it gets any errors during the rest of the build and during DI if required services cannot be found or some other issue occurs.virtual
method onFunctionStartup
, called on app startup immediately after build before any triggers are processedTimerTrigger
set toRunOnStartup
. I cannot speak to the rest of Azure's users but I want to use my logger on app startup whenThat is: I want to log, only once, when I have made a change, to see if it happened as expected.
Describe alternatives you've considered
It is possible to get logging on startup using a
TimerTriggerAttribute
set toRunOnStartup
but the guidance for that is:Alternatively, during startup I can log with Console.WriteLine - but then my logs don't get gathered by DataDog and I have to go find them elsewhere.
The text was updated successfully, but these errors were encountered: