Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adding diagnostic logs for startup and function loading #236

Merged
merged 2 commits into from
Mar 10, 2021

Conversation

brettsam
Copy link
Member

@brettsam brettsam commented Mar 5, 2021

In Kusto, these two logs will look like:

ApplicationStarted:

{
  "ProcessId": 6176,
  "WorkerVersion": "1.0.0.0",
  "ProductVersion": "1.0.0-preview5-local202103051507 Commit hash: N/A",
  "FrameworkDescription": ".NET 5.0.3",
  "OSDescription": "Microsoft Windows 10.0.14393",
  "OSArchitecture": "X64",
  "RuntimeIdentifier": "win10-x86",
  "CommandLine": "C:\\home\\site\\wwwroot\\FunctionReleaseHelperApp.dll C:\\home\\site\\wwwroot\\FunctionReleaseHelperApp.dll --host 127.0.0.1 --port 49306 --workerId 6efc784d-0f90-4e2a-81b5-6e7183a6c9b8 --requestId dcde69af-3ae2-4259-a0e2-b7d96e4bdc4a --grpcMaxMessageLength 2147483647"
}

FunctionLoaded:

{
  "Parameters": [
    {
      "Name": "req",
      "Type": "Microsoft.Azure.Functions.Worker.Http.HttpRequestData",
      "Properties": {}
    }
  ],
  "PathToAssembly": "C:\\home\\site\\wwwroot\\FunctionReleaseHelperApp.dll",
  "EntryPoint": "FunctionReleaseHelperApp.NugetPackageIndexer.Run",
  "Id": "62f3a858-3c3c-4c18-a808-ba8e4ba90aed",
  "Name": "IndexNugetPackages",
  "InputBindings": {
    "req": {
      "Type": "HttpTrigger",
      "Direction": "In"
    }
  },
  "OutputBindings": {
    "QueueOutput": {
      "Type": "Queue",
      "Direction": "Out"
    },
    "Response": {
      "Type": "http",
      "Direction": "Out"
    }
  }
}

@@ -39,6 +39,9 @@ public void Configure(WebJobsBuilderContext context, IWebJobsConfigurationBuilde
{ _dotnetIsolatedWorkerConfigPath, appRootPath },
{ _dotnetIsolatedWorkerExePath, newWorkerDescription.DefaultExecutablePath! }
});

Environment.SetEnvironmentVariable("DOTNET_NOLOGO", "true");
Environment.SetEnvironmentVariable("DOTNET_CLI_TELEMETRY_OPTOUT", "true");
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wondering if this will help any at startup? I'm trying it out...

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would expect the telemetry option wouldn't impact much, as it won't likely ever be running for the first time. Nologo might.

@brettsam brettsam force-pushed the brettsam/loadlog branch 2 times, most recently from 1143b6a to 7008e5b Compare March 8, 2021 17:37
@@ -39,6 +39,9 @@ public void Configure(WebJobsBuilderContext context, IWebJobsConfigurationBuilde
{ _dotnetIsolatedWorkerConfigPath, appRootPath },
{ _dotnetIsolatedWorkerExePath, newWorkerDescription.DefaultExecutablePath! }
});

Environment.SetEnvironmentVariable("DOTNET_NOLOGO", "true");
Environment.SetEnvironmentVariable("DOTNET_CLI_TELEMETRY_OPTOUT", "true");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would expect the telemetry option wouldn't impact much, as it won't likely ever be running for the first time. Nologo might.

namespace Microsoft.Azure.Functions.Worker.Diagnostics
{
/// <summary>
/// Represents an interface for sending logs directly to the Fucctions host.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: Spelling Fucctions

@brettsam brettsam merged commit 9c91a5f into main Mar 10, 2021
@brettsam brettsam deleted the brettsam/loadlog branch March 10, 2021 02:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants