1

I have setup a single Webapp with two webjobs. Both of them are pointing to the same blob container for logging. How are you supposed to tell which webjob is logging what?

For instance, on startup this is what the log file looks like with both jobs in it. I used a different color pen for each. enter image description here

How can you know which lines go with which jobs? With two this is confusing, with 4 or 5 it seems unmanageable. Before I always kept one webjob per webapp but we are using a lot more and trying to consolidate things a bit smarter. Or so I thought.

Is there a place in the code for each webjob where I can assign a name or ID that is attached to each log entry?

Joe Ruder
  • 2,122
  • 2
  • 23
  • 52

1 Answers1

0

You could specify different webjobs by tid, which is the thread id of the thread that produced the event.

Also, you could use Console.WriteLine("hello") to mark the webjobs.

The below image are produced by two queue trigger webjobs. When message comes in, it will explicit output. enter image description here

Joey Cai
  • 18,968
  • 1
  • 20
  • 30
  • Thank you, Won't the TID change from day to day (or run to run)? Also, keeping up with what TID is assigned to which jobs seems like a bad idea. – Joe Ruder Jul 02 '18 at 22:04