TraceWriter logs not getting to analytics










0















I am trying to set up analytics for a test app:



public void ProcessQueueMessage(
[BlobTrigger("blob-injector/name")] CloudBlockBlob blob,
string name,
[Queue("invoice")] ICollector<string> output,
[Blob("blob-archive/name")] CloudBlockBlob archive,
TraceWriter log)


log.Info($"Started processing name");
string content = blob.DownloadText();
log.Info($"retrieved file nameEnvironment.NewLinecontent");
output.Add(content);
log.Info($"name added to queue");
archive.UploadText(content);
log.Info($"name has been archived");
blob.DeleteIfExists();
log.Info($"Completed processing name");



and I have added an appInsights instance to my azure subscription. I am getting some logging from the App service:



enter image description here



I have Diagnostic logging set to log to blob storage and I can find my logs there. all info I am finding seems to state that what I have is all I should need. Yet I cannot find my logs in Application Insights.



[edit}
This is a .net 4.6.1 WebJob if that is pertinent.



[update]
I have changed it to use a TelemetryClient and I get logs with that.










share|improve this question
























  • Which version of Microsoft.Azure.WebJobs.Logging.ApplicationInsights are you using?

    – Ivan Yang
    Nov 13 '18 at 6:08















0















I am trying to set up analytics for a test app:



public void ProcessQueueMessage(
[BlobTrigger("blob-injector/name")] CloudBlockBlob blob,
string name,
[Queue("invoice")] ICollector<string> output,
[Blob("blob-archive/name")] CloudBlockBlob archive,
TraceWriter log)


log.Info($"Started processing name");
string content = blob.DownloadText();
log.Info($"retrieved file nameEnvironment.NewLinecontent");
output.Add(content);
log.Info($"name added to queue");
archive.UploadText(content);
log.Info($"name has been archived");
blob.DeleteIfExists();
log.Info($"Completed processing name");



and I have added an appInsights instance to my azure subscription. I am getting some logging from the App service:



enter image description here



I have Diagnostic logging set to log to blob storage and I can find my logs there. all info I am finding seems to state that what I have is all I should need. Yet I cannot find my logs in Application Insights.



[edit}
This is a .net 4.6.1 WebJob if that is pertinent.



[update]
I have changed it to use a TelemetryClient and I get logs with that.










share|improve this question
























  • Which version of Microsoft.Azure.WebJobs.Logging.ApplicationInsights are you using?

    – Ivan Yang
    Nov 13 '18 at 6:08













0












0








0








I am trying to set up analytics for a test app:



public void ProcessQueueMessage(
[BlobTrigger("blob-injector/name")] CloudBlockBlob blob,
string name,
[Queue("invoice")] ICollector<string> output,
[Blob("blob-archive/name")] CloudBlockBlob archive,
TraceWriter log)


log.Info($"Started processing name");
string content = blob.DownloadText();
log.Info($"retrieved file nameEnvironment.NewLinecontent");
output.Add(content);
log.Info($"name added to queue");
archive.UploadText(content);
log.Info($"name has been archived");
blob.DeleteIfExists();
log.Info($"Completed processing name");



and I have added an appInsights instance to my azure subscription. I am getting some logging from the App service:



enter image description here



I have Diagnostic logging set to log to blob storage and I can find my logs there. all info I am finding seems to state that what I have is all I should need. Yet I cannot find my logs in Application Insights.



[edit}
This is a .net 4.6.1 WebJob if that is pertinent.



[update]
I have changed it to use a TelemetryClient and I get logs with that.










share|improve this question
















I am trying to set up analytics for a test app:



public void ProcessQueueMessage(
[BlobTrigger("blob-injector/name")] CloudBlockBlob blob,
string name,
[Queue("invoice")] ICollector<string> output,
[Blob("blob-archive/name")] CloudBlockBlob archive,
TraceWriter log)


log.Info($"Started processing name");
string content = blob.DownloadText();
log.Info($"retrieved file nameEnvironment.NewLinecontent");
output.Add(content);
log.Info($"name added to queue");
archive.UploadText(content);
log.Info($"name has been archived");
blob.DeleteIfExists();
log.Info($"Completed processing name");



and I have added an appInsights instance to my azure subscription. I am getting some logging from the App service:



enter image description here



I have Diagnostic logging set to log to blob storage and I can find my logs there. all info I am finding seems to state that what I have is all I should need. Yet I cannot find my logs in Application Insights.



[edit}
This is a .net 4.6.1 WebJob if that is pertinent.



[update]
I have changed it to use a TelemetryClient and I get logs with that.







c# azure azure-webjobs azure-application-insights






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 13 '18 at 8:18









Jayendran

3,24731336




3,24731336










asked Nov 12 '18 at 14:50









onesixtyfourthonesixtyfourth

307521




307521












  • Which version of Microsoft.Azure.WebJobs.Logging.ApplicationInsights are you using?

    – Ivan Yang
    Nov 13 '18 at 6:08

















  • Which version of Microsoft.Azure.WebJobs.Logging.ApplicationInsights are you using?

    – Ivan Yang
    Nov 13 '18 at 6:08
















Which version of Microsoft.Azure.WebJobs.Logging.ApplicationInsights are you using?

– Ivan Yang
Nov 13 '18 at 6:08





Which version of Microsoft.Azure.WebJobs.Logging.ApplicationInsights are you using?

– Ivan Yang
Nov 13 '18 at 6:08












1 Answer
1






active

oldest

votes


















1














Assume you are using Microsoft.Azure.WebJobs.Logging.ApplicationInsights 2.2.0.



I can see the TraceWriter logs getting to analytics as per the steps/code below:



1.Create a .net framework 4.6.1 webjob



2.In visual studio Nuget Package Manager, installs the following version packages:



Microsoft.Azure.WebJobs.Logging.ApplicationInsights 2.2.0

System.Configuration.ConfigurationManager 4.5.0

Microsoft.Extensions.Logging.Console 2.1.1


3.In the app.config file, add the following(for local test):



AzureWebJobsDashboard, AzureWebJobsStorage, APPINSIGHTS_INSTRUMENTATIONKEY


The screenshot looks like below:
enter image description here



4.In your azure web app -> application settings, add AzureWebJobsDashboard and APPINSIGHTS_INSTRUMENTATIONKEY, screenshot looks like below:
enter image description here



5.In the Main() method, add the following code:



using Microsoft.Azure.WebJobs;
using Microsoft.Extensions.Logging;
using System.Configuration;

namespace WebJob8

class Program

static void Main()

using (var loggerFactory = new LoggerFactory())

var config = new JobHostConfiguration();

var instrumentationKey = ConfigurationManager.AppSettings["APPINSIGHTS_INSTRUMENTATIONKEY"];
config.DashboardConnectionString = "";
config.LoggerFactory = loggerFactory
.AddApplicationInsights(instrumentationKey, null)
.AddConsole();

if (config.IsDevelopment)

config.UseDevelopmentSettings();


var host = new JobHost(config);
// The following code ensures that the WebJob will be running continuously
host.RunAndBlock();






6.The code in the Functions.cs:



 public class Functions

// This function will get triggered/executed when a new message is written
// on an Azure Queue called queue.
public static void ProcessQueueMessage([QueueTrigger("queue")] string message, TraceWriter log)

log.Info("1113 this is a queue message: "+message);
log.Info("1113 it is a test from azure web jobs!!!");




7.Publish web job to azure, run it, and then nav to azure portal -> your application insights -> search, you can see the log messages:



enter image description here



and it also appears in analytics:
enter image description here






share|improve this answer

























  • Thank you for such a full explanation. I think it is the part in Main linking it all up that I am missing.

    – onesixtyfourth
    Nov 13 '18 at 7:58










Your Answer






StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53264644%2ftracewriter-logs-not-getting-to-analytics%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









1














Assume you are using Microsoft.Azure.WebJobs.Logging.ApplicationInsights 2.2.0.



I can see the TraceWriter logs getting to analytics as per the steps/code below:



1.Create a .net framework 4.6.1 webjob



2.In visual studio Nuget Package Manager, installs the following version packages:



Microsoft.Azure.WebJobs.Logging.ApplicationInsights 2.2.0

System.Configuration.ConfigurationManager 4.5.0

Microsoft.Extensions.Logging.Console 2.1.1


3.In the app.config file, add the following(for local test):



AzureWebJobsDashboard, AzureWebJobsStorage, APPINSIGHTS_INSTRUMENTATIONKEY


The screenshot looks like below:
enter image description here



4.In your azure web app -> application settings, add AzureWebJobsDashboard and APPINSIGHTS_INSTRUMENTATIONKEY, screenshot looks like below:
enter image description here



5.In the Main() method, add the following code:



using Microsoft.Azure.WebJobs;
using Microsoft.Extensions.Logging;
using System.Configuration;

namespace WebJob8

class Program

static void Main()

using (var loggerFactory = new LoggerFactory())

var config = new JobHostConfiguration();

var instrumentationKey = ConfigurationManager.AppSettings["APPINSIGHTS_INSTRUMENTATIONKEY"];
config.DashboardConnectionString = "";
config.LoggerFactory = loggerFactory
.AddApplicationInsights(instrumentationKey, null)
.AddConsole();

if (config.IsDevelopment)

config.UseDevelopmentSettings();


var host = new JobHost(config);
// The following code ensures that the WebJob will be running continuously
host.RunAndBlock();






6.The code in the Functions.cs:



 public class Functions

// This function will get triggered/executed when a new message is written
// on an Azure Queue called queue.
public static void ProcessQueueMessage([QueueTrigger("queue")] string message, TraceWriter log)

log.Info("1113 this is a queue message: "+message);
log.Info("1113 it is a test from azure web jobs!!!");




7.Publish web job to azure, run it, and then nav to azure portal -> your application insights -> search, you can see the log messages:



enter image description here



and it also appears in analytics:
enter image description here






share|improve this answer

























  • Thank you for such a full explanation. I think it is the part in Main linking it all up that I am missing.

    – onesixtyfourth
    Nov 13 '18 at 7:58















1














Assume you are using Microsoft.Azure.WebJobs.Logging.ApplicationInsights 2.2.0.



I can see the TraceWriter logs getting to analytics as per the steps/code below:



1.Create a .net framework 4.6.1 webjob



2.In visual studio Nuget Package Manager, installs the following version packages:



Microsoft.Azure.WebJobs.Logging.ApplicationInsights 2.2.0

System.Configuration.ConfigurationManager 4.5.0

Microsoft.Extensions.Logging.Console 2.1.1


3.In the app.config file, add the following(for local test):



AzureWebJobsDashboard, AzureWebJobsStorage, APPINSIGHTS_INSTRUMENTATIONKEY


The screenshot looks like below:
enter image description here



4.In your azure web app -> application settings, add AzureWebJobsDashboard and APPINSIGHTS_INSTRUMENTATIONKEY, screenshot looks like below:
enter image description here



5.In the Main() method, add the following code:



using Microsoft.Azure.WebJobs;
using Microsoft.Extensions.Logging;
using System.Configuration;

namespace WebJob8

class Program

static void Main()

using (var loggerFactory = new LoggerFactory())

var config = new JobHostConfiguration();

var instrumentationKey = ConfigurationManager.AppSettings["APPINSIGHTS_INSTRUMENTATIONKEY"];
config.DashboardConnectionString = "";
config.LoggerFactory = loggerFactory
.AddApplicationInsights(instrumentationKey, null)
.AddConsole();

if (config.IsDevelopment)

config.UseDevelopmentSettings();


var host = new JobHost(config);
// The following code ensures that the WebJob will be running continuously
host.RunAndBlock();






6.The code in the Functions.cs:



 public class Functions

// This function will get triggered/executed when a new message is written
// on an Azure Queue called queue.
public static void ProcessQueueMessage([QueueTrigger("queue")] string message, TraceWriter log)

log.Info("1113 this is a queue message: "+message);
log.Info("1113 it is a test from azure web jobs!!!");




7.Publish web job to azure, run it, and then nav to azure portal -> your application insights -> search, you can see the log messages:



enter image description here



and it also appears in analytics:
enter image description here






share|improve this answer

























  • Thank you for such a full explanation. I think it is the part in Main linking it all up that I am missing.

    – onesixtyfourth
    Nov 13 '18 at 7:58













1












1








1







Assume you are using Microsoft.Azure.WebJobs.Logging.ApplicationInsights 2.2.0.



I can see the TraceWriter logs getting to analytics as per the steps/code below:



1.Create a .net framework 4.6.1 webjob



2.In visual studio Nuget Package Manager, installs the following version packages:



Microsoft.Azure.WebJobs.Logging.ApplicationInsights 2.2.0

System.Configuration.ConfigurationManager 4.5.0

Microsoft.Extensions.Logging.Console 2.1.1


3.In the app.config file, add the following(for local test):



AzureWebJobsDashboard, AzureWebJobsStorage, APPINSIGHTS_INSTRUMENTATIONKEY


The screenshot looks like below:
enter image description here



4.In your azure web app -> application settings, add AzureWebJobsDashboard and APPINSIGHTS_INSTRUMENTATIONKEY, screenshot looks like below:
enter image description here



5.In the Main() method, add the following code:



using Microsoft.Azure.WebJobs;
using Microsoft.Extensions.Logging;
using System.Configuration;

namespace WebJob8

class Program

static void Main()

using (var loggerFactory = new LoggerFactory())

var config = new JobHostConfiguration();

var instrumentationKey = ConfigurationManager.AppSettings["APPINSIGHTS_INSTRUMENTATIONKEY"];
config.DashboardConnectionString = "";
config.LoggerFactory = loggerFactory
.AddApplicationInsights(instrumentationKey, null)
.AddConsole();

if (config.IsDevelopment)

config.UseDevelopmentSettings();


var host = new JobHost(config);
// The following code ensures that the WebJob will be running continuously
host.RunAndBlock();






6.The code in the Functions.cs:



 public class Functions

// This function will get triggered/executed when a new message is written
// on an Azure Queue called queue.
public static void ProcessQueueMessage([QueueTrigger("queue")] string message, TraceWriter log)

log.Info("1113 this is a queue message: "+message);
log.Info("1113 it is a test from azure web jobs!!!");




7.Publish web job to azure, run it, and then nav to azure portal -> your application insights -> search, you can see the log messages:



enter image description here



and it also appears in analytics:
enter image description here






share|improve this answer















Assume you are using Microsoft.Azure.WebJobs.Logging.ApplicationInsights 2.2.0.



I can see the TraceWriter logs getting to analytics as per the steps/code below:



1.Create a .net framework 4.6.1 webjob



2.In visual studio Nuget Package Manager, installs the following version packages:



Microsoft.Azure.WebJobs.Logging.ApplicationInsights 2.2.0

System.Configuration.ConfigurationManager 4.5.0

Microsoft.Extensions.Logging.Console 2.1.1


3.In the app.config file, add the following(for local test):



AzureWebJobsDashboard, AzureWebJobsStorage, APPINSIGHTS_INSTRUMENTATIONKEY


The screenshot looks like below:
enter image description here



4.In your azure web app -> application settings, add AzureWebJobsDashboard and APPINSIGHTS_INSTRUMENTATIONKEY, screenshot looks like below:
enter image description here



5.In the Main() method, add the following code:



using Microsoft.Azure.WebJobs;
using Microsoft.Extensions.Logging;
using System.Configuration;

namespace WebJob8

class Program

static void Main()

using (var loggerFactory = new LoggerFactory())

var config = new JobHostConfiguration();

var instrumentationKey = ConfigurationManager.AppSettings["APPINSIGHTS_INSTRUMENTATIONKEY"];
config.DashboardConnectionString = "";
config.LoggerFactory = loggerFactory
.AddApplicationInsights(instrumentationKey, null)
.AddConsole();

if (config.IsDevelopment)

config.UseDevelopmentSettings();


var host = new JobHost(config);
// The following code ensures that the WebJob will be running continuously
host.RunAndBlock();






6.The code in the Functions.cs:



 public class Functions

// This function will get triggered/executed when a new message is written
// on an Azure Queue called queue.
public static void ProcessQueueMessage([QueueTrigger("queue")] string message, TraceWriter log)

log.Info("1113 this is a queue message: "+message);
log.Info("1113 it is a test from azure web jobs!!!");




7.Publish web job to azure, run it, and then nav to azure portal -> your application insights -> search, you can see the log messages:



enter image description here



and it also appears in analytics:
enter image description here







share|improve this answer














share|improve this answer



share|improve this answer








edited Nov 13 '18 at 7:32

























answered Nov 13 '18 at 7:04









Ivan YangIvan Yang

2,604125




2,604125












  • Thank you for such a full explanation. I think it is the part in Main linking it all up that I am missing.

    – onesixtyfourth
    Nov 13 '18 at 7:58

















  • Thank you for such a full explanation. I think it is the part in Main linking it all up that I am missing.

    – onesixtyfourth
    Nov 13 '18 at 7:58
















Thank you for such a full explanation. I think it is the part in Main linking it all up that I am missing.

– onesixtyfourth
Nov 13 '18 at 7:58





Thank you for such a full explanation. I think it is the part in Main linking it all up that I am missing.

– onesixtyfourth
Nov 13 '18 at 7:58

















draft saved

draft discarded
















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53264644%2ftracewriter-logs-not-getting-to-analytics%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Kleinkühnau

Makov (Slowakei)

Deutsches Schauspielhaus