0

I have an Azure WebJob that runs as a singleton. The console log file ends up recording a lot of "Renewing singleton lock..." messages, because the job is a long-running one.

Is there a way to stop generating those messages, or reduce their frequency? They don't seem to add anything to my process monitoring.

I know I can change the default lock duration in the job configuration settings. But I can only extend it to 60 seconds, from the default 15. While that would presumably reduce the frequency of the messages by a 3/4, I'm interested in seeing if there's a way to eliminate them entirely.

Startup Code

Not much to it, but here it is:

public static void Main(string[] args)
{
    var config = new JobHostConfiguration();
    config.Tracing.ConsoleLevel = TraceLevel.Error;

    if( config.IsDevelopment )
    {
        config.UseDevelopmentSettings();
    }

    JobHost host = new JobHost( config );

    host.RunAndBlock();
}

I'm using Microsoft.Azure.WebJobs 1.1.2, under the net46 framework.

Mark Olbert
  • 6,584
  • 9
  • 35
  • 69

2 Answers2

2

That is a Verbose level trace message, so if you set JobHostConfiguration.Tracing.ConsoleLevel to TraceLevel.Info you won't see those anymore.

mathewc
  • 13,312
  • 2
  • 45
  • 53
  • I tried Info, as well as Warning, and I still get those console messages. I'm setting the level in program Main(); does it need to be done somewhere in the message processing function? – Mark Olbert Sep 01 '16 at 15:34
  • Please update your question above to show your startup code and how you're configuring the level. I just tried and it works for me. What version of the SDK are you using? – mathewc Sep 01 '16 at 15:38
0

Thanx to mathewc asking me to post the configuration code, I realized that calling config.UseDevelopmentSettings() might be overwriting the trace level I'd set.

Moving the trace level setting below the call to UseDevelopmentSettings() solved the problem. No more flurry of messages!

Mark Olbert
  • 6,584
  • 9
  • 35
  • 69